andy
andy

Reputation: 8875

undefined method 'paper_trail_event='

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?

Upvotes: 1

Views: 556

Answers (2)

Batkins
Batkins

Reputation: 5706

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.

Upvotes: 2

Jason Carty
Jason Carty

Reputation: 1247

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

Upvotes: 0

Related Questions