We've moved discussions to Discord

Audited or other gem for model revisions?

William Flanagan
I'm trying to use Jumpstart and so far it's going OK.  But, for the life of me, I can't seem to get the Audited gem to reliably work.  When I created the initial model, it seems to have written. From there, it seems to ignore any state changes.

I'm wondering if 1) anyone else is running into this type of problem, and/or 2) what gems people are using for revision control? 

Chris Oliver
Hey  William Flanagan ! Jumpstart's a standard Rails 6 app, so there's nothing that should affect the Audited gem.

Can you explain what's going on in more detail?
William Flanagan
Sure, I can. 

I added the audited to the class using only the "audited" bare keyword.

class Funnel < ApplicationRecord
  audited
  has_associated_audits
  enum status: { draft: 0, published: 1 }
  has_rich_text :description
end

When I change the status, it works just fine. However, when I edit the description, it doesn't write an audit record with the changes. 

I've isolated it to that.. rich text fields don't trigger an audit. 
Chris Oliver
ActionText is an association, not a field on the model, so that's probably your issue. You'll want to look through the Audited docs / issues to see how they handle that situation.
William Flanagan
Yeah, I just realized that.. that's totally the reason. Thanks. 
Notifications
You’re not receiving notifications from this thread.