Question

I've followed the extremely simple set up guide for the paper_trail gem.

In my class I've got

class MyClass
 has_paper_trail on:[:update]

Everything is working fine, until I decided to set my own trail events as per the paper_trail guide:

PaperTrail supplies a custom accessor method called paper_trail_event, which it will attempt to use to fill the event field before falling back on one of the default events.

So now, in one of my model methods, I set the event like so:

def change_status
 self.paper_trail_event = 'status_change_event'
 self.status = 'pending'
 self.save
end

But when I do this I get this error:

undefined method `paper_trail_event='

What am I doing wrong?

Was it helpful?

Solution

As mentioned in responses to the GitHub issue you filed against the repo, this feature was just implemented into the master branch a few days ago, and there has not been an official release yet. It will be available once 2.7.2 is released.

OTHER TIPS

The error says you are calling on a method which does not exist. Do you have a method called paper_trail_status ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top