aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-04-12 07:33:11 +0930
committerGitHub <noreply@github.com>2017-04-12 07:33:11 +0930
commitfff414ede72ee2dcb39a67aefb4ee6e5c2fd1db0 (patch)
treeb89779bd338cd57da9206e43b0b091326809062a /activemodel/lib/active_model
parentacc5a55118515227537d0e7b8b129b303cfaf667 (diff)
parent8de7df5b22e853f028e5a71b26d45a0ce7a2c0f4 (diff)
downloadrails-fff414ede72ee2dcb39a67aefb4ee6e5c2fd1db0.tar.gz
rails-fff414ede72ee2dcb39a67aefb4ee6e5c2fd1db0.tar.bz2
rails-fff414ede72ee2dcb39a67aefb4ee6e5c2fd1db0.zip
Merge pull request #28729 from matthewd/dont-freeze-inputs
Don't freeze input strings
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/type/string.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/type/string.rb b/activemodel/lib/active_model/type/string.rb
index c7e0208a5a..850cab962b 100644
--- a/activemodel/lib/active_model/type/string.rb
+++ b/activemodel/lib/active_model/type/string.rb
@@ -12,7 +12,12 @@ module ActiveModel
private
def cast_value(value)
- ::String.new(super)
+ case value
+ when ::String then ::String.new(value)
+ when true then "t".freeze
+ when false then "f".freeze
+ else value.to_s
+ end
end
end
end