Hauleth
Hauleth

Reputation: 23566

paper_trail and keeping relations untouched

Is there any possibility to force paper_trail to not change relations when it's version changes?

My app is a betting software and I need to keep user bets on the one that was active at the time when he was betting, retaining the possibility to change odds.

Upvotes: 3

Views: 424

Answers (1)

rovermicrover
rovermicrover

Reputation: 1453

Do you mean you want to ignore updates to certain attributes? So like if odds are changed then don't do anything?

Or do you mean for it not to create a version when a related object changes?

Either way I think the following from the docs will work

https://github.com/airblade/paper_trail#choosing-attributes-to-monitor

has_paper_trail :skip => [:attribute_or_relationship]

Which will stop the version from being created but also leave out the above from all versions.

Upvotes: 1

Related Questions