aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-10-27 17:16:45 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-10-27 17:16:45 +0100
commitc94ba8150a726da4a894cd8325ee682a3286ec9f (patch)
treed9a7c710747e8f9e491ca74edfa17c20a1f9020e /activerecord/lib/active_record/base.rb
parent9e2bb2caff2b6fd4712ca3db258b68a588a69e9a (diff)
downloadrails-c94ba8150a726da4a894cd8325ee682a3286ec9f.tar.gz
rails-c94ba8150a726da4a894cd8325ee682a3286ec9f.tar.bz2
rails-c94ba8150a726da4a894cd8325ee682a3286ec9f.zip
Fixed that serialized strings should never be type-casted (i.e. turning "Yes" to a boolean)(Andreas Korth) [#857 state:committed]
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index b89c8641aa..9c5690d3fd 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -2938,7 +2938,7 @@ module ActiveRecord #:nodoc:
end
def object_from_yaml(string)
- return string unless string.is_a?(String)
+ return string unless string.is_a?(String) && string =~ /^---/
YAML::load(string) rescue string
end