-
Notifications
You must be signed in to change notification settings - Fork 901
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
Error with Single Table Inheritance #738
Comments
I can't reproduce this issue. Here's what I tried: https://gist.github.com/jaredbeck/122239d2e62717f44808 What are we doing differently? |
Hi and sorry for being so late with my answer, I was on holidays a few days. I could now isolate the the issue a way better. I edited your code sample so that the error is more visible. It seems to be an issue with Single Table Inheritance - nothing to do with calling self.* as I thought first: You can switch paper_trail version between 4.0.2 and 4.1.0 I located that in
This error usually is suppressed and rescued by returning an empty Hash. I hope you can reproduce it now? |
Yes, I see the same error in I'm not sure this is a bug though. Maybe you're supposed to |
Assuming this is not a bug (see above) I'd still like to find a way to provide a better error message. |
Thanks for your reply. |
Oops, I didn't catch that part, sorry. So this is a regression between 4.0 and 4.1. Noted, thanks! |
To summarize, in https://gist.github.com/sreuterle/7de97c87741fe1da422a34c9bae1701d
|
Fixes NoMethodError when an STI parent class is unversioned and thus does not respond to `unserialize_attribute_changes_for_paper_trail!` [Fixes #738]
Fixed by 23ffbdc Sven, please try |
Yeah, I upgraded to 5.x and it works. Thank you very much! |
…rsions. Versions > 4.0.2 contains a bug that affects our setup with STI: paper-trail-gem/paper_trail#738 The bug was fixed in version 5.0.0 but this version introduces other breaking changes (whodunnit) that would require code changes and considerable testing before releasing.
The issue paper-trail-gem/paper_trail#738 that was locking paper_trail to the version we were currently using was solved and its available since 6.X. For all purposes, this also takes the opportunity to upgrade the version to the lost recent one. I've been through all the deprecation notes in the gem and it doesn't seems there's anything on our code impacted by it. NOTE: This also solves the deprecation notice that was appearing when running RSpec: ``` DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from <top (required)> at config/application.rb:8) ```
I'm using paper_trail 4.0.2 with ruby 2.3.0, rails 4.2.6. I want to update to latest version of paper_trail (4.1.0).
With new version running I can't refer to self.version from within a module.
I encapsulated history related stuff into a
ActiveSupport::Concern
for my model 'User':Calling
was_attribute_changed?
on a User instance (no problem) refers to the methodlast_changeset
within the same module (no problem too). This calls the PaperTrail methodversions
but gets an error:This error only occurs with version 4.1.0 of paper_trail but not with 4.0.2. It occurs with both rails 4.2.6 and 4.2.5
Is there any change regarding that? Is it a feature or is it a bug?
I don't know how to use your template for reporting bugs, sorry.
The text was updated successfully, but these errors were encountered: