aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAgis- <corestudiosinc@gmail.com>2013-04-06 10:57:46 +0300
committerAgis- <corestudiosinc@gmail.com>2013-04-06 20:34:50 +0300
commit666a248b0c38ceb93a4dc2da76e28b0cbd7283df (patch)
tree1f2ca6e74ab30bbc9a13ccd5e09426d77004a4e3 /activerecord/lib/active_record
parent941986c7db3f4abaed6f859a4d7b93e6445039c4 (diff)
downloadrails-666a248b0c38ceb93a4dc2da76e28b0cbd7283df.tar.gz
rails-666a248b0c38ceb93a4dc2da76e28b0cbd7283df.tar.bz2
rails-666a248b0c38ceb93a4dc2da76e28b0cbd7283df.zip
Deprecate ActiveRecord#Base.default_scopes?
See #10107.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/scoping/default.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb
index cde4f29d08..8a90528ce8 100644
--- a/activerecord/lib/active_record/scoping/default.rb
+++ b/activerecord/lib/active_record/scoping/default.rb
@@ -5,8 +5,17 @@ module ActiveRecord
included do
# Stores the default scope for the class.
- class_attribute :default_scopes, instance_writer: false
+ class_attribute :default_scopes, instance_writer: false, instance_predicate: false
+
self.default_scopes = []
+
+ def self.default_scopes?
+ ActiveSupport::Deprecation.warn(
+ "#default_scopes? is deprecated. Do something like #default_scopes.empty? instead."
+ )
+
+ !!self.default_scopes
+ end
end
module ClassMethods