Rename User#public to User#identifiable
authorTom Hughes <tom@compton.nu>
Thu, 24 Apr 2014 23:16:35 +0000 (00:16 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 4 Jul 2014 18:24:25 +0000 (19:24 +0100)
app/controllers/changeset_controller.rb
app/models/user.rb
test/models/user_test.rb

index 735fa73a88c31a1820515aa9e4677011946be8b3..b236ba6b577b9e02a906d9a787ddf6e328f15203 100644 (file)
@@ -284,7 +284,7 @@ class ChangesetController < ApplicationController
       elsif params[:bbox]
         changesets = conditions_bbox(changesets, BoundingBox.from_bbox_params(params))
       elsif params[:friends] && @user
-        changesets = changesets.where(:user_id => @user.friend_users.public)
+        changesets = changesets.where(:user_id => @user.friend_users.identifiable)
       elsif params[:nearby] && @user
         changesets = changesets.where(:user_id => @user.nearby)
       end
index 81154fff7ad9dcabed5f7045da7b76b119046e68..010cdf464b3acf9a66858a8a91006e6ddb4720c4 100644 (file)
@@ -26,7 +26,7 @@ class User < ActiveRecord::Base
 
   scope :visible, -> { where(:status => ["pending", "active", "confirmed"]) }
   scope :active, -> { where(:status => ["active", "confirmed"]) }
-  scope :public, -> { where(:data_public => true) }
+  scope :identifiable, -> { where(:data_public => true) }
 
   has_attached_file :image,
     :default_url => "/assets/:class/:attachment/:style.png",
index 5e03c7e0322c576a76cfa3c8cbe0cf7b78352fa8..93bb348ba361b4e43f3062ab5364b7a5fa2c421d 100644 (file)
@@ -180,10 +180,10 @@ class UserTest < ActiveSupport::TestCase
     end
   end
 
-  def test_public
-    assert_equal 16, User.public.count
+  def test_identifiable
+    assert_equal 16, User.identifiable.count
     assert_raise ActiveRecord::RecordNotFound do
-      User.public.find(users(:normal_user).id)
+      User.identifiable.find(users(:normal_user).id)
     end
   end