aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorScott Barron <scott@elitists.net>2005-09-27 09:25:17 +0000
committerScott Barron <scott@elitists.net>2005-09-27 09:25:17 +0000
commit76a7a525576fa1ed12a362fac5da6e2f8b6dc92c (patch)
treed96db542655dc63362a04f09ff567acec1aca8b7 /activerecord/lib
parentf5f7beb3692a2919943f44b10b29852b30f8fb1e (diff)
downloadrails-76a7a525576fa1ed12a362fac5da6e2f8b6dc92c.tar.gz
rails-76a7a525576fa1ed12a362fac5da6e2f8b6dc92c.tar.bz2
rails-76a7a525576fa1ed12a362fac5da6e2f8b6dc92c.zip
Fix serialization problem with YAML in 1.8.3
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2360 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb15
1 files changed, 1 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 37ed2071cf..e8b92da941 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1476,20 +1476,7 @@ module ActiveRecord #:nodoc:
def object_from_yaml(string)
return string unless string.is_a?(String)
- if has_yaml_encoding_header?(string)
- begin
- YAML::load(string)
- rescue Object
- # Apparently wasn't YAML anyway
- string
- end
- else
- string
- end
- end
-
- def has_yaml_encoding_header?(string)
- string[0..3] == "--- "
+ YAML::load(string) rescue string
end
def clone_attributes(reader_method = :read_attribute, attributes = {})