diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-09-13 16:19:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-13 16:19:45 -0400 |
commit | 19cb7a9887aa74304e01e5d3b0cb4ecfe6bd554b (patch) | |
tree | e36b390ab7402e675169185f53d1280f7ac9db94 /actionpack/lib | |
parent | b20762e56c0412aee02bd244a3128c933c484e52 (diff) | |
parent | 34326af1d44be1c17fb8208578b25d7162a118fe (diff) | |
download | rails-19cb7a9887aa74304e01e5d3b0cb4ecfe6bd554b.tar.gz rails-19cb7a9887aa74304e01e5d3b0cb4ecfe6bd554b.tar.bz2 rails-19cb7a9887aa74304e01e5d3b0cb4ecfe6bd554b.zip |
Merge pull request #33569 from eric-hemasystems/conditional-flash-helper
Conditionally use `helper_method` in Flash concern
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/metal/flash.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/flash.rb b/actionpack/lib/action_controller/metal/flash.rb index 5115c2fadf..1ecee811fb 100644 --- a/actionpack/lib/action_controller/metal/flash.rb +++ b/actionpack/lib/action_controller/metal/flash.rb @@ -33,10 +33,12 @@ module ActionController #:nodoc: types.each do |type| next if _flash_types.include?(type) - define_method(type) do - request.flash[type] + if respond_to? :helper_method + define_method(type) do + request.flash[type] + end + helper_method type end - helper_method type self._flash_types += [type] end |