aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2016-09-27 14:33:16 +0200
committerJean Boussier <jean.boussier@gmail.com>2016-09-27 14:33:16 +0200
commit33fd23e0772fab8932b66486e2c4993376db7f94 (patch)
tree49ba0491ed6b0d76e25c1340f419cb485bc6267b /activemodel/lib/active_model
parent7750b049eedfc639e3d5b8f06b51743d71962dd2 (diff)
downloadrails-33fd23e0772fab8932b66486e2c4993376db7f94.tar.gz
rails-33fd23e0772fab8932b66486e2c4993376db7f94.tar.bz2
rails-33fd23e0772fab8932b66486e2c4993376db7f94.zip
Do not leak the Errors default proc when calling to_hash or as_json
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/errors.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index 191039f598..72746e194e 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -280,7 +280,7 @@ module ActiveModel
messages[attribute] = array.map { |message| full_message(attribute, message) }
end
else
- messages.dup
+ without_default_proc(messages)
end
end