Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noma4i/mongo_trails
AR PaperTrail to MongoDB storage
https://github.com/noma4i/mongo_trails
activerecord audit mongodb rails ruby
Last synced: 3 days ago
JSON representation
AR PaperTrail to MongoDB storage
- Host: GitHub
- URL: https://github.com/noma4i/mongo_trails
- Owner: noma4i
- License: mit
- Created: 2020-08-27T01:42:40.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-20T03:55:19.000Z (12 months ago)
- Last Synced: 2024-10-18T00:18:05.498Z (27 days ago)
- Topics: activerecord, audit, mongodb, rails, ruby
- Language: Ruby
- Homepage:
- Size: 192 KB
- Stars: 4
- Watchers: 4
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.com/noma4i/mongo_trails.svg?branch=master)](https://travis-ci.com/noma4i/mongo_trails)
# PaperTrail to MongoDB storage
## Addon for PaperTrail
Track changes to your models, for auditing or versioning. See how a model looked
at any stage in its lifecycle, revert it to any version, or restore it after it
has been destroyed.## Limitations
- `PaperTrail-AssociationTracking` are not supported in full.## How to Use
Add to Gemfile
```ruby
gem 'mongo_trails', git: 'https://github.com/noma4i/mongo_trails'
```Create initializer like:
```ruby
PaperTrail.config.mongo_config = { hosts: ['localhost:27017'], database: 'my_test_db' }
PaperTrail.config.mongo_prefix = lambda do
'my_cool_prefix'
endrequire 'mongo_trails/mongo_support/config'
```Done!
## Config Options
`PaperTrail.config.mongo_config = { hosts: ['localhost:27017'], database: 'my_test_db' }` - Options for MongoDB connection
`PaperTrail.config.mongo_prefix = 'my_versions' # or Lambda` - Versions prefix for MongoDB collection
`PaperTrail.config.enable_sidekiq = false` - Enable Sidekiq to proccess versions
`PaperTrail.config.sidekiq_worker = PaperTrail::WriteVersionWorker` - Worker class
`PaperTrail.config.sidekiq_options = { queue: :default }` - Options for Sidekiq