gauge/app/models/talk.rb
2017-09-25 16:07:48 +03:00

16 lines
431 B
Ruby

class Talk < ActiveResource::Base
has_many :selections, class_name: 'SelectedTalk'
self.site = "https://cfp.openfest.org/api/conferences/4"
self.element_name = "event"
def self.ordered_by_id
find(:all, from: :halfnarp_friendly).sort_by(&:id)
end
def self.ordered_by_rating
ratings = Ratings.new
find(:all, from: :halfnarp_friendly).sort { |left, right| ratings[right.id] <=> ratings[left.id] }
end
end