If say I have this class:
class MyClass
self.belongs_to(:user)
end
Is there a way to programatically determine who MyClass belongs to?
If say I have this class:
class MyClass
self.belongs_to(:user)
end
Is there a way to programatically determine who MyClass belongs to?
look at ActiveRecord::Reflection::ClassMethods, specifically the
reflect_on_all_associations() and reflections() methods
Adam
oops, forgot to post the link
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs