diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-02 07:08:12 +0530 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-02 08:07:33 +0530 |
commit | 71db2420a1ffb73dad6fd4ca64be01e422c2b37d (patch) | |
tree | 6e1322befbbe91c47feb54477c8726f12fa9810c /activerecord/lib | |
parent | aa3ff85f4700d3b1bec92eb963bff8c6e88529e5 (diff) | |
download | rails-71db2420a1ffb73dad6fd4ca64be01e422c2b37d.tar.gz rails-71db2420a1ffb73dad6fd4ca64be01e422c2b37d.tar.bz2 rails-71db2420a1ffb73dad6fd4ca64be01e422c2b37d.zip |
calling default_scope without a proc will raise ArgumentError
Calling default_scope without a proc will now raise `ArgumentError`.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/scoping/default.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb index 59bdb9166e..a5d6aad3f0 100644 --- a/activerecord/lib/active_record/scoping/default.rb +++ b/activerecord/lib/active_record/scoping/default.rb @@ -83,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] |