search for: relatedclass

Displaying 1 result from an estimated 1 matches for "relatedclass".

2005 Apr 27
4
has_many syntax
Hi all, I have the following inside of an AR class definition: relationships=ActiveRecord::Base.connection.select_all(my_relationships_sql) relationships.each do |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=Ac...