-3

We already use some log for our users activity to improve their experience. But we would like to increase our support by logging some important users activity.

I found some gems like pfeedor audited but it seems that none let us scope Model records objects. I explain : Our goal is to have something like a vip bool on our User model that is the condition for the gem to record the activity.

Is there something or did we need to create our custom process?

Thanks

Thibaud Renaux
  • 280
  • 1
  • 17

1 Answers1

1

Try this library https://github.com/airblade/paper_trail It's well maintained and has feature you need.

You can limit logging based on boolean field in you record like this:

class User < ActiveRecord::Base
  has_paper_trail :if => Proc.new { |user| user.vip? }
end

More details in doc here: https://github.com/airblade/paper_trail#2b-choosing-when-to-save-new-versions

Kirill Platonov
  • 401
  • 3
  • 6