lib/devise/rails/warden_compat.rb in devise-1.1.4 vs lib/devise/rails/warden_compat.rb in devise-1.1.5
- old
+ new
@@ -42,10 +42,14 @@
# We cannot use Rails Indifferent Hash because it messes up the flash object.
class Devise::IndifferentHash < Hash
alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
alias_method :regular_update, :update unless method_defined?(:regular_update)
+ def [](key)
+ super(convert_key(key))
+ end
+
def []=(key, value)
regular_writer(convert_key(key), value)
end
alias_method :store, :[]=
@@ -86,9 +90,10 @@
undef :symbolize_keys!
def symbolize_keys; to_hash.symbolize_keys end
def to_options!; self end
+ def to_hash; Hash.new.update(self) end
protected
def convert_key(key)
key.kind_of?(Symbol) ? key.to_s : key
\ No newline at end of file