]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Fix new rubocop warnings
[rails.git] / app / models / user.rb
index 6e9062a801f8f41d18e8c9cca100f59a51d1d05f..0bff6868a31ef45e9de31867049c12630a83fc12 100644 (file)
 #  users_home_idx                (home_tile)
 #
 
-class User < ActiveRecord::Base
+class User < ApplicationRecord
   require "xml/libxml"
 
-  self.ignored_columns = %w[image_file_name image_fingerprint image_content_type]
-
   has_many :traces, -> { where(:visible => true) }
   has_many :diary_entries, -> { order(:created_at => :desc) }
   has_many :diary_comments, -> { order(:created_at => :desc) }
@@ -204,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))
@@ -220,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
 
   ##