Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How do you get the names of models that have MyObject has_many of?
- class MyObject
- has_many :other_objects
- class OtherObject
- belongs_to :my_object
- MyObject.reflect_on_all_associations.map{|a| a.name.to_s} #=> ["other_objects"]
- MyClass.reflections
Advertisement
Add Comment
Please, Sign In to add comment