diff options
author | Xavier Noria <fxn@hashref.com> | 2016-07-13 18:21:41 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-07-13 18:23:13 +0200 |
commit | 451437c6f57e66cc7586ec966e530493927098c7 (patch) | |
tree | 9ad651379547698481de0980d75e0e874e3686fc /activerecord/lib/active_record/core.rb | |
parent | 3b55ac22c920c366080fe3b56c9c3a3728f69f57 (diff) | |
download | rails-451437c6f57e66cc7586ec966e530493927098c7.tar.gz rails-451437c6f57e66cc7586ec966e530493927098c7.tar.bz2 rails-451437c6f57e66cc7586ec966e530493927098c7.zip |
adds support for limits in batch processing
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index de337b24d6..2c94463acd 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -72,11 +72,20 @@ module ActiveRecord ## # :singleton-method: - # Specifies if an error should be raised on query limit or order being + # Specifies if an error should be raised if the query has an order being # ignored when doing batch queries. Useful in applications where the - # limit or scope being ignored is error-worthy, rather than a warning. + # scope being ignored is error-worthy, rather than a warning. + mattr_accessor :error_on_ignored_order, instance_writer: false + self.error_on_ignored_order = false + mattr_accessor :error_on_ignored_order_or_limit, instance_writer: false - self.error_on_ignored_order_or_limit = false + 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: |