Displaying 1 result from an estimated 1 matches for "relationshipname".
2005 Apr 27
4
has_many syntax
...|relationship|
has_many RelatedItems, :class_name => relationship[''RelatedClass''],
:foreign_key => relationship[''ForeignKey'']
end
This kind of works, but how can I assign the name of the relationships?
my_relationships_sql retrieves a field called "RelationshipName", and what I
would like to do is something like this:
relationships=ActiveRecord::Base.connection.select_all(my_relationships_sql)
relationships.each do |relationship|
has_many :association_id => relationship[''RelationshipName''], :class_name
=> relationship[''...