aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/scoping/default.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/scoping/default.rb')
-rw-r--r--activerecord/lib/active_record/scoping/default.rb13
1 files changed, 2 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb
index d37d33d552..a5d6aad3f0 100644
--- a/activerecord/lib/active_record/scoping/default.rb
+++ b/activerecord/lib/active_record/scoping/default.rb
@@ -8,14 +8,6 @@ module ActiveRecord
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
@@ -91,12 +83,11 @@ module ActiveRecord
scope = Proc.new if block_given?
if scope.is_a?(Relation) || !scope.respond_to?(:call)
- ActiveSupport::Deprecation.warn(
- "Calling #default_scope without a block is deprecated. For example instead " \
+ raise ArgumentError,
+ "Support for calling #default_scope without a block is removed. For example instead " \
"of `default_scope where(color: 'red')`, please use " \
"`default_scope { where(color: 'red') }`. (Alternatively you can just redefine " \
"self.default_scope.)"
- )
end
self.default_scopes += [scope]