Questions tagged [paper-trail-gem]
a Ruby gem for tracking changes in your model data
paper-trail-gem
304
questions
0
votes
0
answers
16
views
Issue with Psych::DisallowedClass Exception when using reify in PaperTrail with Sinatra
I am working on a Ruby project using Sinatra version 3.0.6 and Ruby version 3.0.0. I am using the PaperTrail gem (version 15.1.0) to track changes in my models for auditing and version control ...
0
votes
1
answer
45
views
Both controller level and Model level metadata simultaneously in the same column of record. how to store in PaperTrail: versions table
I'm encountering an issue with PaperTrail in my Rails application where I'm trying to store both controller-level and model-level metadata in the versions table, but only the controller-level metadata ...
0
votes
1
answer
105
views
How to Implement `around_perform` callback after including Sidekiq (Sidekiq::Job) inside ApplicationJob
To streamline the inheritance of Sidekiq::Job into all of my jobs and as an attempt to leverage Rails' built-in callbacks, I've implemented ApplicationJob like this to log whodunnit data (I have also ...
0
votes
1
answer
50
views
How to capture custom metadata in PaperTrail only on create event type and work normally for update and destroy [duplicate]
has_paper_trail on: [:create], meta: { object: "custom data" }
this works only for create event
has_paper_trail on: [:create], meta: { object: "custom data" }
has_paper_trail on: [:...
0
votes
2
answers
65
views
Is it possible to add custom data in meta in papertrail only in the 'create' event
has_paper_trail meta:{
object: 'custom_data'
}
this is my code need to have a condition where we add meta only in case of create
i tried this
has_paper_trail meta: {
object: ->{ ...
1
vote
1
answer
109
views
Overriding object_changes on paper trails to store name corresponding to change in IDs
For associations, I am assigning IDs from different model to my model and therefore IDs are being changed. Papertrail tracks those changes, and this is the state of my object_changes:
{
"...
0
votes
1
answer
32
views
Why isn't order() taking effect on papertrail version associations?
I am using papertrail gem to track versions of my Problem and Outcome models.
I can successfully order Papertrail::Versions like so:
PaperTrail::Version.order(created_at: :desc).limit(1).select(:id)
...
0
votes
1
answer
275
views
Paper_trail gem stopped working when upgraded ransack to 4.0.0
In my rails 7.0.4 app I use:
activeadmin 3.0.0
ransack 4.0.0
paper_trail 15.0.0
I have the page for filtering and sorting history of changes to the data:
ActiveAdmin.register PaperTrail::Version do
...
0
votes
1
answer
72
views
Save (restore deleted) AR object without triggering Rails' AR lifecycle callbacks?
Although this question is caused by the PaperTrail gem, it's also applicable to the Rails' ActiveRecord in general.
TL;DR:
How do I save/create the new ActiveRecord object without triggering the ...
1
vote
0
answers
118
views
Rails App: using multiple versions table in paper_trail
I am using Rails 7.0.4 with Ruby 3.0.4 for my app.
The app used multiple databases with Active Record (primary and secondary), each on a specific server.
In the app, I have different models, all of ...
0
votes
0
answers
55
views
PaperTrail gem issue with activemodel (and MS SQL)
I'm trying to set up PaperTrail gem to work with Rails 7 (Ruby 3.2.2) and MS SQL database. It looks like something is wrong with serializing/deserializing dates when using JSON as PaperTrail's ...
0
votes
0
answers
76
views
PaperTrial Version Change set showing Null for date_of_birth Column having date time datatype
I have a patient model having so many columns. One column is date of birth having datetime datatype. In one case I had to insert value in patient table as date datatype instead of datetime in date of ...
2
votes
0
answers
102
views
How delete/anonymize sensitive data and keep its integrity?
I am working on Calcometer, an app that helps healthcare workers (and sales people) keep track of the distance and time they spend driving between appointments.
Tech stack: Ruby on Rails, StimulusJS ...
1
vote
1
answer
85
views
Use a subclass with the Paper Trail gem
In my Rails app, I have a parent class Assessment with various subclasses LanguageAssessment, MathsAssessment etc. Every model in the application has_papertrail as this is on ApplicationRecord. When ...
0
votes
1
answer
164
views
Paper trail object changes and rails enums
I'm working on versioning models in an old project. almost all of the enum's values used in the project are integers. when tracking changes with object_changes the values are displayed as integers, ...