-
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
extend with custom scope #546
Comments
the
|
Thanks for that @sergiobayona . I was actually trying to get all versions created on a day, across all the ActiveRecord models using PaperTrail, rather than on an instance of a single model. |
Yes... at least I think that should be more or less how it works.. So, I think you would need to define it as a method in current versions of rails instead of declaring a Also, you may be able to leverage some of the existing scope methods on the |
@equivalentideas - To get all the versions created on a particular day, you could call |
That does the job, thank @batter . |
Thanks for the amazing gem ;)
I'm trying the add a new scope to Version to return all the versions from a specific day. I added an initializer paper_trail.rb with:
—but, I'm unable to call this in a view, I get the error 'NoMethodError - undefined method `created_on_date' for #PaperTrail::Version::ActiveRecord_Relation:0x007fc50048c1b0'.
This is more a support question than an issue sorry, but is this the right way to extend the Class?
Thanks for your help
The text was updated successfully, but these errors were encountered: