Kai Schlamp
2010-Dec-08 17:07 UTC
ActiveRecord serialize field and SerializationTypeMismatch
Hello. In one of my ActiveRecord models I specified a a serialize field: serialize :settings MyModelSettings If I understand the documentation correctly this restricts settings to the class MyModelSettings. The problem is that this is so restrictive that I even don''t know how to initialize the field. MyModel.new or even MyModel.new(:settings => MyModelSettings) everything I do leads to ActiveRecord::SerializationTypeMismatch: settings was supposed to be a MyModelSettings, but was a String Where is the correct place to initialize the settings (preferable inside my model)? Regards, Kai -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Apparently Analagous Threads
- ActiveRecord SerializationTypeMismatch MySQL SQLite
- SerializationTypeMismatch in Production Mode
- Bug with serialized columns in console ?
- Instance or local vars for field helpers in partial template
- ActiveRecord serialize method not returning YAML array in test environment.