Merge remote-tracking branch 'upstream/pull/1948'
[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)
-                   .order(sql_for_distance)
+                   .order(Arel.sql(sql_for_distance))
                    .limit(num)
     else
       nearby = []