josh ruby

How to get all associted models of rails model – Josh Software

How to get all associted models of rails model – Josh Software I have Site Model and i wanted to find all associated models of Site model which are having belongs_to relationship.After doing lot headache, here is the solution i found has_many models of Site Model Site.reflect_on_all_associations.map{|mac| mac.class_name if mac.macro==:has_many}.compact => [“Layout”, “User”, “SubmenuLink”, “Snippet”, …

How to get all associted models of rails model – Josh Software Read More »