How do you write a Rails model method to return a list of its associations? -
what i'm trying write method return of model's outing_locations, has has_many relationship. class outing < activerecord::base attr_accessible :description, :end_time, :start_time, :title, :user_id belongs_to :user has_many :outing_locations has_many :outing_guests has_one :time_range, :foreign_key => "element_id", :conditions => { :element_type => "outing" } validates :title, :presence => true validates :start_time, :presence => true # regex validates :end_time, :presence => true # regex def host_name return user.find(self.user_id).full_name end end i'm trying block in particular work. there's model called outinginvite, contains id of particular outing. need use grab proper outing , pull said outing's associated outing locations. here's rough sample: <%@outing_invites.each |invite|%> ... <% @party = outing.where(:id => invite.outing_id) %> <% @party.out...