PaperTrail
Track changes to your rails models (by paper-trail-gem)
Discard
šš Soft deletes for ActiveRecord done right (by jhawthorn)
| PaperTrail | Discard | |
|---|---|---|
| 20 | 5 | |
| 7,019 | 2,407 | |
| 0.3% | 0.7% | |
| 6.2 | 5.1 | |
| 30 days ago | 11 days ago | |
| Ruby | Ruby | |
| MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PaperTrail
Posts with mentions or reviews of PaperTrail.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-05-13.
-
Ask HN: How do you "replay" a costly user mistake in your internal software?
With Ruby on Rails one can use https://github.com/paper-trail-gem/paper_trail which will keep a record of every database change. Similarly one could record every database query on the database server.
Looking at clicks sounds like recording the screen of the user. Too many privacy issues IMHO even for an internal tool.
-
RDS Database Migration Series - Facing The Giant: How we migrated 11 TB database
The primary culprits were two tables (and their huge indexes) that contributed approximately 90% to the total size of the database. One of them was an audit trail (paper trail versions, to be exact), and the second one was more domain-specific for short-term rentals. It's a pre-computed cache of prices for properties depending on various conditions so that they don't need to be computed each time on the fly and can be easily distributed to other services.
-
historical data and "point in time" data modeling techniques, advice.
if the source (web) application makes their own audit tables. ex: our ruby on rails application uses the paper-trail gem
-
Best rails tools to automatically handle logging of things like all a user's actions, or changes to a record in a module - primarily for audit purposes.
Start with https://github.com/paper-trail-gem/paper_trail
-
Inventory/Sales Management module built on a Rails app - what would be the best way to "version" updates made against an SKU.
We use paper_trail for this
-
is there a gem for tracking adhoc rails console changes
I think you could use that in conjunction with the paper_trail gem, as /u/GreenCalligrapher571 mentioned, which is also a good suggestion. As an additional note, when changing records in production while using the paper_trail gem, I suggest wrapping your database-mutating statements executed in the rails console within a whodunnit block, so PaperTrail.request(whodunnit: 'Dorian MariƩ') { widget.update name: 'Wibble' } or something rather than just widget.update name: 'Wibble'. Or, if you have some sort of issue-tracking / ticketing system, you could set the whodunnit value to the ticket number or whatever, and then anyone who wants to know why the records are in the state they're in can consult that ticket, which hopefully has additional relevant context.
-
History Tracking With Postgres
For a while we did this using the paper-trail gem. This was a very simple way to add a few lines of code to keep track of all of the changes made to an ActiveRecord model. But it came with one drawback. Every change to the data had to be done through ActiveRecord. There are often times when this makes an app vulnerable to a race condition. Iāll use a contrived example so as not to share any real code from our clientās app.
-
Adding soft delete to a Phoenix Commanded (CQRS) API
In most designs, this would probably not be possible unless a table tracking extension is being used in an ORM. Even with change tracking enabled through extensions like paper trail or Django simple history, it can be tricky to restore deleted entities. Object tracking would need to have been enabled before it is needed to ensure the data is still around to be restored.
- Looking for a Rails Gem that Audits Manual Database Changes
Discard
Posts with mentions or reviews of Discard.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-08-12.
-
Donāt allow associations on discarded records
Hello there! I am using the Discard gem. I basically want new records associated to them to be invalid.
- Accessing point in time data when data changes over time
-
What are the gems that every Ruby dev should know how to use?
discard - a soft-delete implementation that avoids a lot of the gotchas associated with paranoia or acts_as_paranoid gem.
-
Rails application boilerplate for fast MVP development
add discard
-
Looking For Gem Recommendations For Alternatives
indeed discard offers better performance options than paranoia: https://github.com/jhawthorn/discard#working-with-associations
What are some alternatives?
When comparing PaperTrail and Discard you can also consider the following projects:
Audited - Audited (formerly acts_as_audited) is an ORM extension that logs all changes to your Rails models.
ActsAsParanoid - ActiveRecord plugin allowing you to hide and restore records without actually deleting them.
Logidze - Database changes log for Rails
Paranoia - acts_as_paranoid for Rails 5, 6 and 7
arel-helpers - Useful tools to help construct database queries with ActiveRecord and Arel.