Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

AS::Callbacks#run_callbacks remove key argument

  • Loading branch information...
commit c1ce4144d1ef5bea3d829167cb52a5abc8d2ef7e 1 parent 42a14c4
@frodsan frodsan authored
View
2  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*
View
3  activesupport/lib/active_support/callbacks.rb
@@ -74,8 +74,7 @@ module Callbacks
# 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
View
2  activesupport/test/callback_inheritance_test.rb
@@ -29,7 +29,7 @@ def after2
end
def dispatch
- run_callbacks(:dispatch, action_name) do
+ run_callbacks :dispatch do
@log << action_name
end
self
View
6 activesupport/test/callbacks_test.rb
@@ -112,7 +112,7 @@ def log2
end
def dispatch
- run_callbacks :dispatch, action_name do
+ run_callbacks :dispatch do
@logger << "Done"
end
self
@@ -153,7 +153,7 @@ def starts_false
end
def save
- run_callbacks :save, :action
+ run_callbacks :save
end
end
@@ -338,7 +338,7 @@ def action
end
def save
- run_callbacks :save, "hyphen-ated" do
+ run_callbacks :save do
@stuff
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.