aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/metal/flash.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/metal/flash.rb b/actionpack/lib/action_controller/metal/flash.rb
index 1ecee811fb..380f2e9591 100644
--- a/actionpack/lib/action_controller/metal/flash.rb
+++ b/actionpack/lib/action_controller/metal/flash.rb
@@ -33,12 +33,10 @@ module ActionController #:nodoc:
types.each do |type|
next if _flash_types.include?(type)
- if respond_to? :helper_method
- define_method(type) do
- request.flash[type]
- end
- helper_method type
+ define_method(type) do
+ request.flash[type]
end
+ helper_method(type) if respond_to?(:helper_method)
self._flash_types += [type]
end