I am still using latest Rails 1.8, not 2. Using the "serialize :attribute_name" method on an ActiveRecord, if the serialization ends up being too long for the field, with a MySQL database, it will just be silently truncated. Of course, this makes it so it can''t be unserialized again, and you end up with a raw string in the attribute instead of actually the unserialized object you expected. Is there any easy way to get an exception to be raised on save if the serialized value will be truncated? Sadly, validates_length_of doesn''t do it, because it tries to call #length on the pre-serialized object, which depending on the class of the object will give an irrelevant value (Hash.length or Array.length), or even raise a method not found exception. Any ideas? Jonathan -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---