Ruby on Rails order by associated model - find.(:order => ”)

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

Comments