]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Fix new rubocop warnings
[rails.git] / app / models / user.rb
index 1095dc6eaccbf9e4466d4b80bc6764d81f76371b..0bff6868a31ef45e9de31867049c12630a83fc12 100644 (file)
@@ -43,7 +43,7 @@
 #  users_home_idx                (home_tile)
 #
 
-class User < ActiveRecord::Base
+class User < ApplicationRecord
   require "xml/libxml"
 
   has_many :traces, -> { where(:visible => true) }
@@ -202,7 +202,7 @@ class User < ActiveRecord::Base
       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 < ActiveRecord::Base
   end
 
   def is_friends_with?(new_friend)
-    friendships.where(:befriendee => new_friend).exists?
+    friendships.exists?(:befriendee => new_friend)
   end
 
   ##