From ea7b48b0748a7a9c87ec9409039e3e436bbe51fc Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sat, 7 Jul 2012 09:16:48 -0300 Subject: Use "instance_accessor" for flash types class attribute --- actionpack/lib/action_controller/metal/flash.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_controller') 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 -- cgit v1.2.3