0.0
The project is in a healthy, maintained state
Create, update, and delete records within a block, assign the same request_uuid to them, and be able to easily view and undo them
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 4.9, < 6.0
>= 5.2, < 7.2
 Project Readme

AuditGroup

Group ActiveRecord operations together by assigning all of their audits the same request_uuid.

Requirements

Installation

From RubyGems.org

Globally

gem i omg-audit-group

In Gemfile

gem 'omg-audit-group'

Testing locally

# Build gem
rake build

# Install gem
## From this directory
rake install

## From other directory
gem i -l /path/to/this/folder/omg-audit-group-0.1.0.gem

Usage

Load the gem

require 'audit_group'

Using class methods

# Group operations under the same request_uuid
AuditGroup.request { perform_some_operations }

# View the last request_uuid
AuditGroup.request_uuid

# View the audits from the last request
AuditGroup.audits

# Save the AuditGroup instance for later
audit_group = AuditGroup.current

Saving Request object for later use

# Group operations under the same request_uuid
audit_group = AuditGroup.request { perform_some_operations }

# View the last request_uuid
audit_group.request_uuid

# View the audits from the last request
audit_group.audits

Passing in a request_uuid

AuditGroup.request(request_uuid: some_record.audits.last.request_uuid)

Performing a dry run

View how records would change without committing the transaction

audit_group = AuditGroup.request(dry_run: true) { perform_some_operations }
audit_group.audits

Running tests

bundle exec rspec # option 1
rake spec         # option 2
rspec             # option 3