Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.group(options = {})
- options[:order] = 'created_at DESC'
- options[:conditions] = { :status => @@status[:published] }
- groups = find(:all, options).group_by(&:title)
- groups.each_pair do |title, trailers|
- groups[title] = trailers.sort {|a,b| b.bitrate <=> a.bitrate }
- end
- groups
- end
Add Comment
Please, Sign In to add comment