Permalink
Browse files

Remove deprecated configuration `.error_on_ignored_order_or_limit`

  • Loading branch information...
rafaelfranca committed Sep 15, 2017
1 parent 9c6ee1b commit e1066f450d1a99c9a0b4d786b202e2ca82a4c3b3
Showing with 4 additions and 48 deletions.
  1. +4 −0 activerecord/CHANGELOG.md
  2. +0 −20 activerecord/lib/active_record/core.rb
  3. +0 −28 activerecord/test/cases/batches_test.rb
@@ -1,3 +1,7 @@
* Remove deprecated configuration `.error_on_ignored_order_or_limit`.
*Rafael Mendonça França*
* Remove deprecated arguments from `#verify!`.
*Rafael Mendonça França*
@@ -76,26 +76,6 @@ def self.configurations
# scope being ignored is error-worthy, rather than a warning.
mattr_accessor :error_on_ignored_order, instance_writer: false, default: false
def self.error_on_ignored_order_or_limit
ActiveSupport::Deprecation.warn(<<-MSG.squish)
The flag error_on_ignored_order_or_limit is deprecated. Limits are
now supported. Please use error_on_ignored_order instead.
MSG
error_on_ignored_order
end
def error_on_ignored_order_or_limit
self.class.error_on_ignored_order_or_limit
end
def self.error_on_ignored_order_or_limit=(value)
ActiveSupport::Deprecation.warn(<<-MSG.squish)
The flag error_on_ignored_order_or_limit is deprecated. Limits are
now supported. Please use error_on_ignored_order= instead.
MSG
self.error_on_ignored_order = value
end
##
# :singleton-method:
# Specify whether or not to use timestamps for migration versions
@@ -586,34 +586,6 @@ def test_find_in_batches_should_return_a_sized_enumerator
end
end
test ".error_on_ignored_order_or_limit= is deprecated" do
begin
prev = ActiveRecord::Base.error_on_ignored_order
assert_deprecated "Please use error_on_ignored_order= instead." do
ActiveRecord::Base.error_on_ignored_order_or_limit = true
end
assert ActiveRecord::Base.error_on_ignored_order
ensure
ActiveRecord::Base.error_on_ignored_order = prev
end
end
test ".error_on_ignored_order_or_limit is deprecated" do
expected = ActiveRecord::Base.error_on_ignored_order
actual = assert_deprecated "Please use error_on_ignored_order instead." do
ActiveRecord::Base.error_on_ignored_order_or_limit
end
assert_equal expected, actual
end
test "#error_on_ignored_order_or_limit is deprecated" do
expected = ActiveRecord::Base.error_on_ignored_order
actual = assert_deprecated "Please use error_on_ignored_order instead." do
Post.new.error_on_ignored_order_or_limit
end
assert_equal expected, actual
end
test ".find_each respects table alias" do
assert_queries(1) do
table_alias = Post.arel_table.alias("omg_posts")

0 comments on commit e1066f4

Please sign in to comment.