diff options
author | Mike Mangino <mmangino@elevatedrails.com> | 2013-03-28 11:19:01 -0400 |
---|---|---|
committer | Mike Mangino <mmangino@elevatedrails.com> | 2013-03-28 11:19:01 -0400 |
commit | a4743960a09139c3bd4d72a8f3a72ade8f4add2f (patch) | |
tree | 086c63e4962de057b67c160da89f4cb91800f86b /activerecord/lib | |
parent | 51ba66b92df1a07390128725cd7ad7ee9be9c1bd (diff) | |
download | rails-a4743960a09139c3bd4d72a8f3a72ade8f4add2f.tar.gz rails-a4743960a09139c3bd4d72a8f3a72ade8f4add2f.tar.bz2 rails-a4743960a09139c3bd4d72a8f3a72ade8f4add2f.zip |
Raise an exception when unserialization fails due to a missing class
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/coders/yaml_column.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/coders/yaml_column.rb b/activerecord/lib/active_record/coders/yaml_column.rb index 8d22942a06..1aa82f20d6 100644 --- a/activerecord/lib/active_record/coders/yaml_column.rb +++ b/activerecord/lib/active_record/coders/yaml_column.rb @@ -33,7 +33,8 @@ module ActiveRecord obj ||= object_class.new if object_class != Object obj - rescue ArgumentError, Psych::SyntaxError + rescue ArgumentError , Psych::SyntaxError => e + raise if e.to_s =~ /undefined class/ yaml end end |