-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 2.7 is incompatible with rails 3.0.x #197
Comments
Thanks for the bug report. You are correct about this. Looks like pull #180 is the culprit here. The idea for the pull was absolutely spot on, in the sense that PaperTrail should store serialized versions of objects in the This isn't a total incompatibility with |
Impressive response time! I've just tested and the tip of master is working great with our 3.0.20 project (and will switch permanently when you release 2.7.1). Many thanks. |
Cheers, thanks for the heads up, otherwise I wouldn't have been aware of it. I'm actually a lot happier with this implementation since it essentially provides a fail-safe. |
Since upgrading to the latest version of paper_trail (from
2.6
to2.7
), our3.0.20
rails project has been throwing an exceptionNoMethodError (undefined method
dump' for Object:Class)whenever we try to save any model instances that declare
serialize :foo` for some field.After delving into the problem, it appears that paper_trail's new means of serializing
serialize
attributes on models in version2.7
seems to be causing my rails3.0.20
installations to flip out.The changes here: v2.6.4...v2.7.0#L5R88 specifically the use of
ModelName.serialized_attributes['column_name'].dump
andModelName.serialized_attributes['column_name'].load
are causing issues with 3.0.20 where ActiveRecord::Coders sadly doesn't exist.To demonstrate, given a Person model with
serialize :name
set.Note that above with
3.2.11
, theActiveRecord::Coders::YAMLColumn
has both.dump
and.load
methods available as required.Note that with 3.0.20 the default serialization class
Object
has no.dump
method, and an unrelated.load
method. This seems to be because in3.0.20
theModelName.serialized_objects
hash values contain the class used to validate the output of the unserialized model attribute, however in 3.1.* theserialized_objects
hash values instead contain thecoder
class, as specified by encode_with, defaulting to YAML.I hope I'm on the right track but I'm surprised no one else has pointed out this incompatibility yet... I'll keep my fingers crossed that there isn't a massive message in your README saying that 2.7 is incompatible with rails 3.0.
The text was updated successfully, but these errors were encountered: