diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-01 19:40:42 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-01 19:40:42 -0700 |
commit | 7f35c409024b61f7a9ff9bc983d08da58ffb3893 (patch) | |
tree | 6e1322befbbe91c47feb54477c8726f12fa9810c /activerecord/lib | |
parent | aa3ff85f4700d3b1bec92eb963bff8c6e88529e5 (diff) | |
parent | 71db2420a1ffb73dad6fd4ca64be01e422c2b37d (diff) | |
download | rails-7f35c409024b61f7a9ff9bc983d08da58ffb3893.tar.gz rails-7f35c409024b61f7a9ff9bc983d08da58ffb3893.tar.bz2 rails-7f35c409024b61f7a9ff9bc983d08da58ffb3893.zip |
Merge pull request #11229 from neerajdotname/deprecated-default-scope
calling default_scope without a proc will 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] |