Commit 2547177caf4809628d9f26704a071224027173cb
1 parent
859e9ba8
Exists in
master
and in
29 other branches
rails3: fix profile_list_block query
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/models/profile_list_block.rb
... | ... | @@ -18,9 +18,9 @@ class ProfileListBlock < Block |
18 | 18 | result = nil |
19 | 19 | visible_profiles = profiles.visible.includes([:image,:domains,:preferred_domain,:environment]) |
20 | 20 | if !prioritize_profiles_with_image |
21 | - result = visible_profiles.all(:limit => limit, :order => 'updated_at DESC').sort_by{ rand } | |
21 | + result = visible_profiles.all(:limit => limit, :order => 'profiles.updated_at DESC').sort_by{ rand } | |
22 | 22 | elsif profiles.visible.with_image.count >= limit |
23 | - result = visible_profiles.with_image.all(:limit => limit * 5, :order => 'updated_at DESC').sort_by{ rand } | |
23 | + result = visible_profiles.with_image.all(:limit => limit * 5, :order => 'profiles.updated_at DESC').sort_by{ rand } | |
24 | 24 | else |
25 | 25 | result = visible_profiles.with_image.sort_by{ rand } + visible_profiles.without_image.all(:limit => limit * 5, :order => 'profiles.updated_at DESC').sort_by{ rand } |
26 | 26 | end | ... | ... |