Commit 912e277e8002ec4e6535a37fa6d953f6a9b0818f

Authored by Victor Costa
2 parents 2707bac7 2547177c

Merge branch 'rails3' into rails3_stable

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,9 +18,9 @@ class ProfileListBlock < Block
18 result = nil 18 result = nil
19 visible_profiles = profiles.visible.includes([:image,:domains,:preferred_domain,:environment]) 19 visible_profiles = profiles.visible.includes([:image,:domains,:preferred_domain,:environment])
20 if !prioritize_profiles_with_image 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 elsif profiles.visible.with_image.count >= limit 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 else 24 else
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 } 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 end 26 end