-
Notifications
You must be signed in to change notification settings - Fork 904
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_at throws an error #288
Comments
Which version of |
Thanks for the quick response. I'm using |
So you've definitely passed in the |
Yep. |
Please try running this in your console. Say you have a model named > Widget.version_class_name
=> "PaperTrail::Version" # this is the default value, wondering what yours returns
> Widget.versions_association_name
=> :versions # again, this is the default value, wondering what yours returns In fact it would be helpful if you could provide a gist or a copy of the code for one of the models and it's counterpart custom version class. I'm having difficulty helping to debug with the limited information you've provided. Thanks. |
Sure thing. Here are the relevant parts of my model:
And I also have
My tables are named And, in the console, I have:
Thanks for all the help. |
And you also added an initializer like so (as the README states is necessary for custom version classes)? # config/initializers/paper_trail.rb
PaperTrail::Version.module_eval do
self.abstract_class = true
end |
Yes, I have that initializer as well. |
@JacobEvelyn - Think I figured out the issue and fixed it with eb01ca3. Please try using the head of the
|
Ah, beautiful! Works perfectly. Thanks for the help and the quick fix! |
I'm using a separate version class for each of my versioned models, and when I call
object.version_at(timestamp)
I unfortunately get:Looks like the versions table and columns aren't getting found properly. Is this a known issue?
The text was updated successfully, but these errors were encountered: