No commit activity in last 3 years
No release in over 3 years
Gem for collecting the deleted record for ActiveRecord to a new table named as (original_name_of_table)_backup in same database or (original_name_of_table) in other database if other database configurations are provided in database.yml with ["#{RUBY_ENV}_backup"].
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Destroyed Record Collector

Gem for collecting the deleted record for ActiveRecord to a new table named as (original_name_of_table)_backup in same database or (original_name_of_table) in other database if other database configurations are provided in database.yml with ["#{RUBY_ENV}_backup"].

Installation

Add to Gemfile run bundle install:

# Gemfile
gem 'destroyed_record_collector'

Usage

if data is to be backed up in the same database then nothing is to be provided (table will be created with model_name_backup) else if data is to be backed up in different database then define a new setting in config/database.yml (table will be created as of same table name) the name should be "#{RUBY_ENV}_backup"

development_backup:
  adapter: mysql2
  encoding: utf8
  database: destroyed_development
  pool: 5
  username: username
  password: password
  socket: /var/run/mysqld/mysqld.sock

it will create backup for all models and if some models are needed to exclude from backup should have a method 'exclude_from_backup' which will return true. Else all models will have a backup table.

def exclude_from_backup
return true //if backup is not needed
end