X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/32fa1246986473126505fd3d3f2687cd7bd19825..ca7721168f8576adf461b58193260e10aa14be7f:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 518cb94cc..0bff6868a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -202,7 +202,7 @@ class User < ApplicationRecord sql_for_area = QuadTile.sql_for_area(gc.bounds(radius), "home_") sql_for_distance = gc.sql_for_distance("home_lat", "home_lon") nearby = User.active.identifiable - .where("id != ?", id) + .where.not(:id => id) .where(sql_for_area) .where("#{sql_for_distance} <= ?", radius) .order(Arel.sql(sql_for_distance)) @@ -218,7 +218,7 @@ class User < ApplicationRecord end def is_friends_with?(new_friend) - friendships.where(:befriendee => new_friend).exists? + friendships.exists?(:befriendee => new_friend) end ##