Guest User

Untitled

a guest
Mar 13th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def self.group(options = {})
  2. options[:order] = 'created_at DESC'
  3. options[:conditions] = { :status => @@status[:published] }
  4. groups = find(:all, options).group_by(&:title)
  5.  
  6. groups.each_pair do |title, trailers|
  7. groups[title] = trailers.sort {|a,b| b.bitrate <=> a.bitrate }
  8. end
  9. groups
  10. end
Add Comment
Please, Sign In to add comment