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 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
... ...