-
Notifications
You must be signed in to change notification settings - Fork 130
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
Change modifier to updater #141
Comments
Looking at the code, the Want to write some tests and try to change the relationship too? We can discuss it over code. |
I have tried to trick it and added into my
It does not worked. When I write About tests... I'm just beginner in Ruby language. |
It doesn't work how? |
I have updated my post above. What I understood, is that on class where I add However in tracker it still will be |
@dblock I have found out why my custom I was using |
In general in Ruby you want to keep the original gems and monkey-patch them in your code (you can declare the class again and add a |
I have class called Category:
I have set modifier_field to :updater.
In my history tracker I have written this:
In my config/initializers/mongoid-history.rb I have written this:
Mongoid::History.tracker_class_name = :history_tracker
Mongoid::History.modifier_class_name = 'Person'
When I create category:
Category.create(name: "Test" updater: Person.all.first)
and then I try to access to my HistoryTracker via console.When I try to get updater like this
It gives me an error:
NoMethodError: undefined method
updater' for #HistoryTracker:0x00000008ceb050`But I when I write this:
HistoryTracker.all.first.modifier
It returns me model.
Why modifier can not chenge to updater?
The text was updated successfully, but these errors were encountered: