Top "Associations" questions

Associations typically refer to relationships between models in ORMs such as ActiveRecord.

Rails 3 -- Pass user.id in hidden form field vs using association

Ok so currently I have a form <div class="field"> <%= f.label :title %><br/> &…

ruby-on-rails ruby-on-rails-3 forms associations has-many
Rails query join association table with alias

I have a model Edge that belongs to the other model Node twice through different foreign keys: def Edge < …

ruby-on-rails join associations
XML ResultMap in MyBatis with association

I see this issue very strange descibed on google or stack. Let me explain. I have Result Maps in annotations …

java associations mybatis dynamicquery xmlmapper
ruby on rails - how to make relationship works in route, controller, view ? has_many, belongs_to

I am struggling to get my relationship in rails to work. I have a User,Gallery,Comment model class Gallery …

ruby-on-rails associations relationship has-many belongs-to
rails renaming associations

I have two models, TreeNode and User. Each user has_one TreeNode, which is the root of the tree. class …

ruby-on-rails associations
Rails Associations has_one Latest Record

I have the following model: class Section < ActiveRecord::Base belongs_to :page has_many :revisions, :class_name => 'SectionRevision', :…

ruby-on-rails activerecord associations
hibernate order by association

I'm using Hibernate 3.2, and using criteria to build a query. I'd like to add and "order by" for a many-to-one …

hibernate sql-order-by associations
Rails Polymorphic has_many

Using Ruby on Rails, how can I achieve a polymorphic has_many relationship where the owner is always of a …

ruby-on-rails associations polymorphic-associations
Could Not Find Inverse Association for has_many in Rails 3

I have the following models: class Business < ActiveRecord::Base has_many :customers, :inverse_of => :business has_many :payments, :…

ruby-on-rails ruby ruby-on-rails-3 associations
Specifying the foreign key in a has_many :through relationship

I have the following three models: User, Project, and Assignment. A User has_many Projects through an assignment. However, Assignment …

ruby-on-rails model associations has-many-through