aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/callbacks.rb10
-rw-r--r--activesupport/test/callbacks_test.rb16
2 files changed, 0 insertions, 26 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 1a830c03b8..296de94e91 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -341,27 +341,17 @@ module ActiveSupport
@key = compute_identifier filter
@if = Array(options[:if])
@unless = Array(options[:unless])
-
- deprecate_per_key_option(options)
end
def filter; @key; end
def raw_filter; @filter; end
- def deprecate_per_key_option(options)
- if options[:per_key]
- raise NotImplementedError, ":per_key option is no longer supported. Use generic :if and :unless options instead."
- end
- end
-
def merge(chain, new_options)
_options = {
:if => @if.dup,
:unless => @unless.dup
}
- deprecate_per_key_option new_options
-
_options[:if].concat Array(new_options.fetch(:unless, []))
_options[:unless].concat Array(new_options.fetch(:if, []))
diff --git a/activesupport/test/callbacks_test.rb b/activesupport/test/callbacks_test.rb
index 5fce1eeafc..f8e2ce22fa 100644
--- a/activesupport/test/callbacks_test.rb
+++ b/activesupport/test/callbacks_test.rb
@@ -772,22 +772,6 @@ module CallbacksTest
end
end
- class PerKeyOptionDeprecationTest < ActiveSupport::TestCase
-
- def test_per_key_option_deprecation
- assert_raise NotImplementedError do
- Phone.class_eval do
- set_callback :save, :before, :before_save1, :per_key => {:if => "true"}
- end
- end
- assert_raise NotImplementedError do
- Phone.class_eval do
- skip_callback :save, :before, :before_save1, :per_key => {:if => "true"}
- end
- end
- end
- end
-
class ExcludingDuplicatesCallbackTest < ActiveSupport::TestCase
def test_excludes_duplicates_in_separate_calls
model = DuplicatingCallbacks.new