diff options
author | José Valim <jose.valim@gmail.com> | 2012-05-10 00:39:47 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-05-10 00:39:47 -0700 |
commit | a45a5d88e4d7425e9fed7bae78fb3e1a3c6221e4 (patch) | |
tree | 9c1c3df391732e39be9da8c762a7f86f2537ab96 | |
parent | 42a14c436c50f8c0ab57ef336e5fab77030107c0 (diff) | |
parent | c1ce4144d1ef5bea3d829167cb52a5abc8d2ef7e (diff) | |
download | rails-a45a5d88e4d7425e9fed7bae78fb3e1a3c6221e4.tar.gz rails-a45a5d88e4d7425e9fed7bae78fb3e1a3c6221e4.tar.bz2 rails-a45a5d88e4d7425e9fed7bae78fb3e1a3c6221e4.zip |
Merge pull request #6241 from frodsan/deprecate_key_callbacks
AS::Callbacks#run_callbacks remove key argument
-rw-r--r-- | activesupport/CHANGELOG.md | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 3 | ||||
-rw-r--r-- | activesupport/test/callback_inheritance_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/callbacks_test.rb | 6 |
4 files changed, 7 insertions, 6 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index c0d780789a..ef96df9227 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,5 +1,7 @@ ## Rails 4.0.0 (unreleased) ## +* `AS::Callbacks#run_callbacks` remove `key` argument. *Francesco Rodriguez* + * `deep_dup` works more expectedly now and duplicates also values in +Hash+ instances and elements in +Array+ instances. *Alexey Gaziev* * Inflector no longer applies ice -> ouse to words like slice, police, ets *Wes Morgan* diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index cbeba3139a..3c7dbb369c 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -74,8 +74,7 @@ module ActiveSupport # save # end # - def run_callbacks(kind, key = nil, &block) - #TODO: deprecate key argument + def run_callbacks(kind, &block) runner_name = self.class.__define_callbacks(kind, self) send(runner_name, &block) end diff --git a/activesupport/test/callback_inheritance_test.rb b/activesupport/test/callback_inheritance_test.rb index e5ac9511df..6be8ea8b84 100644 --- a/activesupport/test/callback_inheritance_test.rb +++ b/activesupport/test/callback_inheritance_test.rb @@ -29,7 +29,7 @@ class GrandParent end def dispatch - run_callbacks(:dispatch, action_name) do + run_callbacks :dispatch do @log << action_name end self diff --git a/activesupport/test/callbacks_test.rb b/activesupport/test/callbacks_test.rb index 25688a9da5..b7c3b130c3 100644 --- a/activesupport/test/callbacks_test.rb +++ b/activesupport/test/callbacks_test.rb @@ -112,7 +112,7 @@ module CallbacksTest end def dispatch - run_callbacks :dispatch, action_name do + run_callbacks :dispatch do @logger << "Done" end self @@ -153,7 +153,7 @@ module CallbacksTest end def save - run_callbacks :save, :action + run_callbacks :save end end @@ -338,7 +338,7 @@ module CallbacksTest end def save - run_callbacks :save, "hyphen-ated" do + run_callbacks :save do @stuff end end |