sequel-activerecord_connection
PaperTrail
sequel-activerecord_connection | PaperTrail | |
---|---|---|
5 | 18 | |
125 | 6,700 | |
- | 0.1% | |
5.9 | 4.8 | |
7 days ago | 6 days ago | |
Ruby | Ruby | |
MIT License | MIT License |
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.
sequel-activerecord_connection
-
What It Took to Build a Rails Integration for Rodauth
For the integration to work, I would need to make Sequel reuse Active Record's database connection. I discussed this idea with Jeremy Evans (the lead Sequel maintainer), and he provided me with some guidance, thanks to which I was able to come up a solution. It was a Sequel extension that retrieved Active Record connections, kept transaction state and callbacks synchronized between Sequel and Active Record, integrated SQL instrumentation, and reconciliated adapter differences (see my previous article for more details).
-
Why Sequel ORM faster than ActiveRecord
Our Rails app at work is using Active Record, but I started non-apologetically using Sequel for any features I'm missing from Active Record, because I don't have the patience for Active Record to catch up. For our analytics database we're using only Sequel, because AR was missing too many features (see my article), while for our main database we're using it in tandem with Active Record, reusing Active Record's database connection. I'm pretty happy that the latter is now possible, as it gives people the opportunity to try out Sequel without any overhead.
-
Ruby gem for authentication : rodauth
The way I look at it, a pure Active Record implementation could never be fully complete. That's why I instead chose the path of making Sequel integrate seamlessly with Active Record, by sharing a database connection as /u/honeyryderchuck said, hooking into Active Record's query instrumentation, and also by making Sequel transactions interoperable with Active Record's. It's also worth noting that core Sequel is significantly lighter than Active Record.
-
How does Ruby's OOP translate to Rails?
the main impediments to my using sequel in Rails are: authentication - which has largely been solved. Janko has written a gem allowing for rod auth to be used with rails, easily. https://github.com/janko/rodauth-rails - i believe he has also written another gem to make it easy to use sequel in a rails app https://github.com/janko/sequel-activerecord_connection
-
Sqlcomposer Early Preview Answering Questions
From a user's perspective, I've always found the fact that rom-sql uses Sequel under-the-hood as a big advantage. For someone who is familiar with Sequel it lowers the barrier of understanding how rom-sql works. And it's possible to leverage many of Sequel's useful features that rom-sql might not support OOTB (including performance optimizations such as sequel_pg), even if that requires dropping to the Sequel database level. When I announced sequel-activerecord_connection, one of the questions I received was whether that will work with rom-sql too (and it does).
PaperTrail
-
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
-
Temporality/time-travelling in DB with ActiveRecord?
Maybe you are looking for the papertrail gem? https://github.com/paper-trail-gem/paper_trail
- Looking for an observer gem
What are some alternatives?
rodauth-rails - Rails integration for Rodauth authentication framework
Audited - Audited (formerly acts_as_audited) is an ORM extension that logs all changes to your Rails models.
rodauth-model - Password attribute and associations for Rodauth account model
Paranoia - acts_as_paranoid for Rails 5, 6 and 7
rodauth-demo-rails - Rodauth's demo site ported to Rails, showing Rodauth/Rails integration
Logidze - Database changes log for Rails
rodauth-demo-rails - Example Rails app that uses Rodauth for authentication
mongoid-history - Multi-user non-linear history tracking, auditing, undo, redo for mongoid.
rodauth-oauth - (Mirror) Roda OAuth and OpenID provider plugin
ActsAsParanoid - ActiveRecord plugin allowing you to hide and restore records without actually deleting them.
Rodauth - Ruby's Most Advanced Authentication Framework
Discard - 🃏🗑 Soft deletes for ActiveRecord done right