summaryrefslogtreecommitdiff
path: root/lib/hashie
diff options
context:
space:
mode:
authorMorgan Jones <mjones@rice.edu>2014-07-09 16:12:17 -0400
committerdB <dblock@dblock.org>2014-07-09 16:12:17 -0400
commitc827f7a3fab76228da3b85968280ace137f3b8f5 (patch)
tree019a20921a04739950f6ad47a8de2bf002603c3f /lib/hashie
parentf4eabadc7cfb57d323f7cc7c92f5a2c53c312da3 (diff)
downloadhashie-c827f7a3fab76228da3b85968280ace137f3b8f5.tar.gz
Fixed stack overflow when coercing mashes that contain ActiveSupport::HashWithIndifferentAccess values.
Diffstat (limited to 'lib/hashie')
-rw-r--r--lib/hashie/extensions/indifferent_access.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hashie/extensions/indifferent_access.rb b/lib/hashie/extensions/indifferent_access.rb
index 4fc5bb7..3c9bb84 100644
--- a/lib/hashie/extensions/indifferent_access.rb
+++ b/lib/hashie/extensions/indifferent_access.rb
@@ -29,11 +29,11 @@ module Hashie
end
base.class_eval do
- alias_method :regular_writer, :[]=
+ alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
alias_method :[]=, :indifferent_writer
alias_method :store, :indifferent_writer
%w(default update replace fetch delete key? values_at).each do |m|
- alias_method "regular_#{m}", m
+ alias_method "regular_#{m}", m unless method_defined?("regular_#{m}")
alias_method m, "indifferent_#{m}"
end