diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-07-07 09:16:48 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-07-07 09:16:48 -0300 |
commit | ea7b48b0748a7a9c87ec9409039e3e436bbe51fc (patch) | |
tree | eff856874456fcb2b4ef77a7ea30ec7a0e6e894a /actionpack/lib | |
parent | 90e42ff16312a46d414c8b31b4119ff31fcc2dba (diff) | |
download | rails-ea7b48b0748a7a9c87ec9409039e3e436bbe51fc.tar.gz rails-ea7b48b0748a7a9c87ec9409039e3e436bbe51fc.tar.bz2 rails-ea7b48b0748a7a9c87ec9409039e3e436bbe51fc.zip |
Use "instance_accessor" for flash types class attribute
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/metal/flash.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/flash.rb b/actionpack/lib/action_controller/metal/flash.rb index 47e71371e3..b078beb675 100644 --- a/actionpack/lib/action_controller/metal/flash.rb +++ b/actionpack/lib/action_controller/metal/flash.rb @@ -3,10 +3,10 @@ module ActionController #:nodoc: extend ActiveSupport::Concern included do - class_attribute :_flash_types, :instance_methods => false + class_attribute :_flash_types, instance_accessor: false self._flash_types = [] - delegate :flash, :to => :request + delegate :flash, to: :request add_flash_types(:alert, :notice) end @@ -14,7 +14,7 @@ module ActionController #:nodoc: def add_flash_types(*types) types.each do |type| next if _flash_types.include?(type) - + define_method(type) do request.flash[type] end |