Skip to content
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

NoMethodError when trying to access history #17

Open
SuperMasterBlasterLaser opened this issue Aug 1, 2015 · 6 comments
Open

NoMethodError when trying to access history #17

SuperMasterBlasterLaser opened this issue Aug 1, 2015 · 6 comments

Comments

@SuperMasterBlasterLaser
Copy link

I Have everything done accrodingly to your guide. When I open my history_index page.

It gives me this error:

undefined method `updater' for #HistoryTracker:0x00000012bf62f8

@paritoshbotre
Copy link

@SuperMasterBlasterLaser can you please give me step to reproduce the issue ?

I tried and it's working fine for me.

@SuperMasterBlasterLaser
Copy link
Author

I solved this problem by using monkey patch.

@ptrikutam
Copy link

@SuperMasterBlasterLaser what was the solution that you implemented to fix this? I'm having the same problem.

@SuperMasterBlasterLaser
Copy link
Author

@ptrikutam

I forked mongoid-audit and in /lib/mongoid-audit/history_tracker.rb I have added this code:

   def updater
      self.modifier
   end

@ptrikutam
Copy link

Thanks @SuperMasterBlasterLaser. Actually -- I just realized that I was getting this error until I ran the migration that is listed in the README. I had database that was set up with the previous version of mongoid-audit and I recently upgraded to version 1.1.0.

HistoryTracker.all.each{|ht| ht.rename(modifier_id: :updater_id)}

Hope this helps someone else coming across this.

@ptrikutam
Copy link

Actually -- after running the migration, I'm still running into this issue intermittently. It seems like restarting the server resolves this, but it keeps coming up at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants