Ruby on Rails order by associated model – find.(:order => ’’)

1   def recent_obituaries(limit)
      2     Obituary.find(:all, :limit => limit, :include => :services, :order => "services.start_time DESC")
      3   end
      4 
      5         # obituaries has_many :services
      6         # services belongs_to :obituary
      

Picture of Scott Motte

delicious facebook rss twitter

Spitfire Sky | github | archives | resume