aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2015-12-15 21:12:16 +0900
committerYuichiro Kaneko <kaneko.yuichiro@moneyforward.co.jp>2015-12-16 19:56:20 +0900
commit21f4017fd904532ebe4964481567d69636a711cf (patch)
treeb8e28d0a5b39f9db1b424df4d0821cf34aa70352 /actionpack
parent2de7385cef62ad12cef5bcfe1de18c4662072344 (diff)
downloadrails-21f4017fd904532ebe4964481567d69636a711cf.tar.gz
rails-21f4017fd904532ebe4964481567d69636a711cf.tar.bz2
rails-21f4017fd904532ebe4964481567d69636a711cf.zip
Deprecate passing string to define callback.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/abstract_controller/callbacks.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/abstract_controller/callbacks.rb b/actionpack/lib/abstract_controller/callbacks.rb
index d5317e4717..d63ce9c1c3 100644
--- a/actionpack/lib/abstract_controller/callbacks.rb
+++ b/actionpack/lib/abstract_controller/callbacks.rb
@@ -48,7 +48,8 @@ module AbstractController
def _normalize_callback_option(options, from, to) # :nodoc:
if from = options[from]
- from = Array(from).map {|o| "action_name == '#{o}'"}.join(" || ")
+ _from = Array(from).map(&:to_s).to_set
+ from = proc {|c| _from.include? c.action_name }
options[to] = Array(options[to]).unshift(from)
end
end