]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Merge branch 'master' into cancancan
[rails.git] / app / models / user.rb
index aaa00169f5210f2ac5fda89f0e1b8bd5d839811e..de5529e025bdbc042c02678a43880fd73d18ca67 100644 (file)
@@ -211,7 +211,7 @@ class User < ActiveRecord::Base
                    .where("id != ?", id)
                    .where(sql_for_area)
                    .where("#{sql_for_distance} <= ?", radius)
                    .where("id != ?", id)
                    .where(sql_for_area)
                    .where("#{sql_for_distance} <= ?", radius)
-                   .order(sql_for_distance)
+                   .order(Arel.sql(sql_for_distance))
                    .limit(num)
     else
       nearby = []
                    .limit(num)
     else
       nearby = []