Commit b6e919f727daca93799d839fcbc4915800a4956b
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'track_order' into stable
* track_order: community_track: set default order to 'hits'
Showing
1 changed file
with
1 additions
and
3 deletions
Show diff stats
plugins/community_track/lib/community_track_plugin/track_list_block.rb
@@ -30,14 +30,12 @@ class CommunityTrackPlugin::TrackListBlock < Block | @@ -30,14 +30,12 @@ class CommunityTrackPlugin::TrackListBlock < Block | ||
30 | def tracks(page=1, per_page=limit) | 30 | def tracks(page=1, per_page=limit) |
31 | tracks = all_tracks | 31 | tracks = all_tracks |
32 | tracks = case order | 32 | tracks = case order |
33 | - when 'hits' | ||
34 | - tracks.order('hits DESC') | ||
35 | when 'newer' | 33 | when 'newer' |
36 | tracks.order('created_at DESC') | 34 | tracks.order('created_at DESC') |
37 | when 'random' | 35 | when 'random' |
38 | tracks.order('random()') | 36 | tracks.order('random()') |
39 | else | 37 | else |
40 | - tracks | 38 | + tracks.order('hits DESC') |
41 | end | 39 | end |
42 | tracks.paginate(:per_page => per_page, :page => page) | 40 | tracks.paginate(:per_page => per_page, :page => page) |
43 | end | 41 | end |