active_archive 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.fasterer.yml +19 -0
- data/.flayignore +2 -0
- data/.reek +20 -0
- data/.rubocop.yml +32 -0
- data/Gemfile +1 -1
- data/README.md +4 -6
- data/Rakefile +1 -1
- data/active_archive.gemspec +23 -18
- data/bin/console +3 -3
- data/bin/rake +5 -6
- data/config/locales/en.yml +2 -2
- data/lib/active_archive/base.rb +51 -48
- data/lib/active_archive/methods.rb +4 -4
- data/lib/active_archive/railtie.rb +19 -0
- data/lib/active_archive/settings.rb +11 -0
- data/lib/active_archive/table_definition.rb +14 -8
- data/lib/active_archive/version.rb +1 -1
- data/lib/active_archive.rb +9 -56
- data/lib/generators/active_archive/install_generator.rb +3 -3
- data/lib/generators/active_archive/templates/install.rb +1 -1
- metadata +78 -3
- data/lib/active_archive/configuration.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 870fb2643b79b471095f5e3c621c56019628cf93
|
4
|
+
data.tar.gz: 5811d3442ada47fc1ddafea1f2acab79212d584d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 213c9daf7f511404a5f92eea6f31a1e978feeb03cbcb32e0b5da70c93906f48332f8c02e2359aa71a8d0611071b6ebdea24049d56ff013f709c7b6cf27c9f29e
|
7
|
+
data.tar.gz: af77de6275006aa877d1326f695fb161b72ce46986c6e39fa5554b7455bf41513a1cc9f69b0bc40b7e9a7331e6b0bf9522446b594e775e6587f30c20035495d3
|
data/.fasterer.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
speedups:
|
2
|
+
rescue_vs_respond_to: true
|
3
|
+
module_eval: true
|
4
|
+
shuffle_first_vs_sample: true
|
5
|
+
for_loop_vs_each: true
|
6
|
+
each_with_index_vs_while: false
|
7
|
+
map_flatten_vs_flat_map: true
|
8
|
+
reverse_each_vs_reverse_each: true
|
9
|
+
select_first_vs_detect: true
|
10
|
+
sort_vs_sort_by: true
|
11
|
+
fetch_with_argument_vs_block: true
|
12
|
+
keys_each_vs_each_key: true
|
13
|
+
hash_merge_bang_vs_hash_brackets: true
|
14
|
+
block_vs_symbol_to_proc: true
|
15
|
+
proc_call_vs_yield: true
|
16
|
+
gsub_vs_tr: true
|
17
|
+
select_last_vs_reverse_detect: true
|
18
|
+
getter_vs_attr_reader: true
|
19
|
+
setter_vs_attr_writer: true
|
data/.flayignore
ADDED
data/.reek
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
Attribute:
|
3
|
+
enabled: false
|
4
|
+
FeatureEnvy:
|
5
|
+
exclude:
|
6
|
+
- 'ActiveArchive::Base#retrieve_dependent_records'
|
7
|
+
IrresponsibleModule:
|
8
|
+
enabled: false
|
9
|
+
NilCheck:
|
10
|
+
enabled: false
|
11
|
+
ManualDispatch:
|
12
|
+
enabled: false
|
13
|
+
NestedIterators:
|
14
|
+
max_allowed_nesting: 2
|
15
|
+
TooManyStatements:
|
16
|
+
max_statements: 10
|
17
|
+
exclude:
|
18
|
+
- 'ActiveArchive::Base#retrieve_dependent_records'
|
19
|
+
UtilityFunction:
|
20
|
+
enabled: false
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
AllCops:
|
2
|
+
DisplayCopNames: true
|
3
|
+
DisplayStyleGuide: true
|
4
|
+
TargetRubyVersion: 2.3
|
5
|
+
LineLength:
|
6
|
+
Max: 120
|
7
|
+
Rails/Delegate:
|
8
|
+
Enabled: false
|
9
|
+
Rails/Output:
|
10
|
+
Enabled: false
|
11
|
+
Style/Alias:
|
12
|
+
EnforcedStyle: prefer_alias_method
|
13
|
+
Style/BracesAroundHashParameters:
|
14
|
+
Enabled: false
|
15
|
+
Style/ClosingParenthesisIndentation:
|
16
|
+
Enabled: false
|
17
|
+
Style/Documentation:
|
18
|
+
Enabled: false
|
19
|
+
Style/EmptyLinesAroundBlockBody:
|
20
|
+
Enabled: false
|
21
|
+
Style/EmptyLinesAroundClassBody:
|
22
|
+
Enabled: false
|
23
|
+
Style/EmptyLinesAroundModuleBody:
|
24
|
+
Enabled: false
|
25
|
+
Style/FirstParameterIndentation:
|
26
|
+
Enabled: false
|
27
|
+
Style/FrozenStringLiteralComment:
|
28
|
+
Enabled: false
|
29
|
+
Style/MultilineMethodCallIndentation:
|
30
|
+
EnforcedStyle: aligned
|
31
|
+
Style/RescueModifier:
|
32
|
+
Enabled: false
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,7 @@ ActiveArchive is a library for preventing database records from being destroyed.
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem
|
14
|
+
gem 'active_archive'
|
15
15
|
```
|
16
16
|
|
17
17
|
And then execute:
|
@@ -37,12 +37,10 @@ Or install it yourself as:
|
|
37
37
|
`rails generate active_archive:install` will generate the following `active_archive.rb` file:
|
38
38
|
|
39
39
|
```ruby
|
40
|
-
# config/initalizers/active_archive.rb
|
40
|
+
# Path: ../config/initalizers/active_archive.rb
|
41
41
|
|
42
|
-
ActiveArchive.configure do |config|
|
43
|
-
|
44
|
-
|
45
|
-
config.all_records_archivable = false
|
42
|
+
ActiveArchive::Settings.configure do |config|
|
43
|
+
config.all_records_archivable = false
|
46
44
|
config.dependent_record_window = 3.seconds
|
47
45
|
end
|
48
46
|
```
|
data/Rakefile
CHANGED
data/active_archive.gemspec
CHANGED
@@ -1,30 +1,35 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require 'active_archive/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'active_archive'
|
8
8
|
spec.version = ActiveArchive::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Juan Gomez']
|
10
|
+
spec.email = ['j.gomez@drexed.com']
|
11
11
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
12
|
+
spec.summary = 'Gem for soft-deleting ActiveRecord objects.'
|
13
|
+
spec.description = 'Prevent database records from being destroyed.'
|
14
|
+
spec.homepage = 'https://github.com/drexed/active_archive'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
-
spec.bindir =
|
17
|
+
spec.bindir = 'exe'
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
-
spec.require_paths =
|
19
|
+
spec.require_paths = %w(lib support)
|
20
20
|
|
21
|
-
spec.add_runtime_dependency
|
21
|
+
spec.add_runtime_dependency 'rails'
|
22
|
+
spec.add_runtime_dependency 'dry-configurable'
|
22
23
|
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
24
|
+
spec.add_development_dependency 'bundler'
|
25
|
+
spec.add_development_dependency 'coveralls'
|
26
|
+
spec.add_development_dependency 'rake'
|
27
|
+
spec.add_development_dependency 'rspec'
|
28
|
+
spec.add_development_dependency 'sqlite3'
|
29
|
+
spec.add_development_dependency 'database_cleaner'
|
30
|
+
spec.add_development_dependency 'generator_spec'
|
31
|
+
spec.add_development_dependency 'fasterer'
|
32
|
+
spec.add_development_dependency 'flay'
|
33
|
+
spec.add_development_dependency 'reek'
|
34
|
+
spec.add_development_dependency 'rubocop'
|
30
35
|
end
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'active_archive'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "active_archive"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start
|
data/bin/rake
CHANGED
@@ -6,11 +6,10 @@
|
|
6
6
|
# this file is here to facilitate running it.
|
7
7
|
#
|
8
8
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
-
Pathname.new(__FILE__).realpath)
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath)
|
12
11
|
|
13
|
-
require
|
14
|
-
require
|
12
|
+
require 'rubygems'
|
13
|
+
require 'bundler/setup'
|
15
14
|
|
16
|
-
load Gem.bin_path(
|
15
|
+
load Gem.bin_path('rake', 'rake')
|
data/config/locales/en.yml
CHANGED
data/lib/active_archive/base.rb
CHANGED
@@ -9,14 +9,14 @@ module ActiveArchive
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def archived?
|
12
|
-
archivable? ?
|
12
|
+
archivable? ? !archived_at.nil? : destroyed?
|
13
13
|
end
|
14
14
|
|
15
15
|
def archivable?
|
16
16
|
respond_to?(:archived_at)
|
17
17
|
end
|
18
18
|
|
19
|
-
def destroy(force=nil)
|
19
|
+
def destroy(force = nil)
|
20
20
|
with_transaction_returning_status do
|
21
21
|
if unarchivable? || should_force_destroy?(force)
|
22
22
|
permanently_delete_records_after { super() }
|
@@ -33,9 +33,9 @@ module ActiveArchive
|
|
33
33
|
I18n.t("active_archive.archival.#{archived? ? :archived : :unarchived}")
|
34
34
|
end
|
35
35
|
|
36
|
-
def unarchive(
|
36
|
+
def unarchive(opts = nil)
|
37
37
|
with_transaction_returning_status do
|
38
|
-
(should_unarchive_parent_first?(
|
38
|
+
(should_unarchive_parent_first?(opts) ? unarchival.reverse : unarchival).each { |record| record.call(opts) }
|
39
39
|
self
|
40
40
|
end
|
41
41
|
end
|
@@ -53,40 +53,34 @@ module ActiveArchive
|
|
53
53
|
private
|
54
54
|
|
55
55
|
def attempt_notifying_observers(callback)
|
56
|
-
notify_observers(callback)
|
57
|
-
rescue NoMethodError
|
58
|
-
# RETURN
|
56
|
+
notify_observers(callback) if respond_to?(:notify_observers)
|
59
57
|
end
|
60
58
|
|
61
|
-
def destroy_with_active_archive(force=nil)
|
59
|
+
def destroy_with_active_archive(force = nil)
|
62
60
|
run_callbacks(:destroy) do
|
63
|
-
|
64
|
-
true
|
61
|
+
archived? || new_record? ? save : set_archived_at(Time.now, force)
|
62
|
+
return(true)
|
65
63
|
end
|
66
64
|
|
67
65
|
archived? ? self : false
|
68
66
|
end
|
69
67
|
|
70
|
-
def
|
68
|
+
def retrieve_archived_record
|
71
69
|
self.class.unscoped.find(id)
|
72
70
|
end
|
73
71
|
|
74
|
-
def
|
72
|
+
def retrieve_dependent_records
|
75
73
|
dependent_records = {}
|
76
74
|
|
77
75
|
self.class.reflections.each do |key, reflection|
|
78
76
|
next unless reflection.options[:dependent] == :destroy
|
79
|
-
next unless records = send(key)
|
80
77
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
records = [] << records
|
85
|
-
end
|
78
|
+
records = send(key)
|
79
|
+
next unless records
|
80
|
+
records.respond_to?(:empty?) ? (next if records.empty?) : (records = [] << records)
|
86
81
|
|
87
82
|
dependent_record = records.first
|
88
|
-
next
|
89
|
-
dependent_records[dependent_record.class] = records.map(&:id)
|
83
|
+
dependent_record.nil? ? next : dependent_records[dependent_record.class] = records.map(&:id)
|
90
84
|
end
|
91
85
|
|
92
86
|
dependent_records
|
@@ -104,16 +98,16 @@ module ActiveArchive
|
|
104
98
|
end
|
105
99
|
|
106
100
|
def permanently_delete_records_after(&block)
|
107
|
-
dependent_records =
|
108
|
-
dependent_results = yield
|
101
|
+
dependent_records = retrieve_dependent_records
|
102
|
+
dependent_results = yield(block)
|
109
103
|
permanently_delete_records(dependent_records) if dependent_results
|
110
|
-
|
104
|
+
dependent_results
|
111
105
|
end
|
112
106
|
|
113
107
|
def unarchival
|
114
108
|
[
|
115
|
-
->(validate) { unarchive_destroyed_dependent_records(validate) },
|
116
|
-
|
109
|
+
-> (validate) { unarchive_destroyed_dependent_records(validate) },
|
110
|
+
lambda do |validate|
|
117
111
|
run_callbacks(:unarchive) do
|
118
112
|
set_archived_at(nil, validate)
|
119
113
|
return(true)
|
@@ -122,44 +116,51 @@ module ActiveArchive
|
|
122
116
|
]
|
123
117
|
end
|
124
118
|
|
125
|
-
def
|
126
|
-
|
127
|
-
"destroy" == reflection.options[:dependent].to_s && reflection.klass.archivable?
|
128
|
-
end.each do |name, reflection|
|
129
|
-
cardinality = reflection.macro.to_s.gsub("has_", "").to_sym
|
130
|
-
case cardinality
|
131
|
-
when :many
|
132
|
-
records = (archived_at ? set_record_window(send(name), name, reflection) : send(name))
|
133
|
-
when :one, :belongs_to
|
134
|
-
self.class.unscoped { records = [] << send(name) }
|
135
|
-
end
|
119
|
+
def dependent_records_for_unarchival(name, reflection)
|
120
|
+
record = send(name)
|
136
121
|
|
137
|
-
|
138
|
-
|
122
|
+
case reflection.macro.to_s.gsub('has_', '').to_sym
|
123
|
+
when :many
|
124
|
+
records = archived_at ? set_record_window(record, name, reflection) : record
|
125
|
+
when :one, :belongs_to
|
126
|
+
self.class.unscoped { records = [] << record }
|
139
127
|
end
|
128
|
+
|
129
|
+
[records].flatten.compact
|
140
130
|
end
|
141
131
|
|
142
|
-
def
|
132
|
+
def unarchive_destroyed_dependent_records(force = nil)
|
133
|
+
self.class.reflections
|
134
|
+
.select { |_, reflection| 'destroy' == reflection.options[:dependent].to_s && reflection.klass.archivable? }
|
135
|
+
.each do |name, reflection|
|
136
|
+
dependent_records_for_unarchival(name, reflection).each { |record| record.unarchive(force) }
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
def set_archived_at(value, force = nil)
|
143
141
|
return self unless archivable?
|
144
|
-
record =
|
142
|
+
record = retrieve_archived_record
|
145
143
|
record.archived_at = value
|
146
144
|
|
147
145
|
begin
|
148
146
|
should_ignore_validations?(force) ? record.save(validate: false) : record.save!
|
149
|
-
@attributes = record.instance_variable_get(
|
150
|
-
rescue =>
|
147
|
+
@attributes = record.instance_variable_get('@attributes')
|
148
|
+
rescue => error
|
151
149
|
record.destroy
|
152
|
-
raise(
|
150
|
+
raise(error)
|
153
151
|
end
|
154
152
|
end
|
155
153
|
|
156
|
-
def set_record_window(
|
154
|
+
def set_record_window(_, name, reflection)
|
155
|
+
quoted_table_name = reflection.quoted_table_name
|
156
|
+
window = ActiveArchive::Settings.config.dependent_record_window
|
157
|
+
|
157
158
|
send(name).unscope(where: :archived_at)
|
158
159
|
.where([
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
160
|
+
"#{quoted_table_name}.archived_at > ? AND #{quoted_table_name}.archived_at < ?",
|
161
|
+
archived_at - window,
|
162
|
+
archived_at + window
|
163
|
+
])
|
163
164
|
end
|
164
165
|
|
165
166
|
def should_force_destroy?(force)
|
@@ -176,3 +177,5 @@ module ActiveArchive
|
|
176
177
|
|
177
178
|
end
|
178
179
|
end
|
180
|
+
|
181
|
+
ActiveRecord::Base.include(ActiveArchive::Base)
|
@@ -2,15 +2,15 @@ module ActiveArchive
|
|
2
2
|
module Methods
|
3
3
|
|
4
4
|
def archivable?
|
5
|
-
columns.detect { |
|
5
|
+
columns.detect { |column| column.name == 'archived_at' }
|
6
6
|
end
|
7
7
|
|
8
|
-
def archive_all(conditions=nil)
|
8
|
+
def archive_all(conditions = nil)
|
9
9
|
conditions ? where(conditions).destroy_all : destroy_all
|
10
10
|
end
|
11
11
|
|
12
|
-
def unarchive_all(conditions=nil)
|
13
|
-
(conditions ? where(conditions) : all).to_a.each
|
12
|
+
def unarchive_all(conditions = nil)
|
13
|
+
(conditions ? where(conditions) : all).to_a.each(&:unarchive)
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ActiveArchive
|
2
|
+
class Railtie < ::Rails::Railtie
|
3
|
+
|
4
|
+
initializer 'active_archive' do |app|
|
5
|
+
ActiveArchive::Railtie.instance_eval do
|
6
|
+
[app.config.i18n.available_locales].flatten.each do |locale|
|
7
|
+
(I18n.load_path << path(locale)) if File.file?(path(locale))
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
protected
|
13
|
+
|
14
|
+
def path(locale)
|
15
|
+
File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -1,14 +1,20 @@
|
|
1
|
-
module
|
2
|
-
module
|
3
|
-
class TableDefinition
|
1
|
+
module ActiveArchive
|
2
|
+
module TableDefinition
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end
|
4
|
+
def timestamps(*args)
|
5
|
+
options = args.extract_options!
|
6
|
+
options[:null] = false if options[:null].nil?
|
9
7
|
|
10
|
-
|
8
|
+
column(:created_at, :datetime, options)
|
9
|
+
column(:updated_at, :datetime, options)
|
11
10
|
|
11
|
+
if ActiveArchive::Settings.config.all_records_archivable == true
|
12
|
+
options[:null] = true
|
13
|
+
column(:archived_at, :datetime, options)
|
14
|
+
end
|
12
15
|
end
|
16
|
+
|
13
17
|
end
|
14
18
|
end
|
19
|
+
|
20
|
+
ActiveRecord::ConnectionAdapters::TableDefinition.prepend(ActiveArchive::TableDefinition)
|
data/lib/active_archive.rb
CHANGED
@@ -1,56 +1,9 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
def self.configuration
|
11
|
-
@configuration ||= Configuration.new
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.configuration=(config)
|
15
|
-
@configuration = config
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.configure
|
19
|
-
yield(configuration)
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
require "active_archive/table_definition"
|
25
|
-
require "active_archive/methods"
|
26
|
-
require "active_archive/scopes"
|
27
|
-
require "active_archive/base"
|
28
|
-
require "generators/active_archive/install_generator"
|
29
|
-
|
30
|
-
ActiveSupport.on_load(:active_record) do
|
31
|
-
ActiveRecord::Base.send(:include, ActiveArchive::Base)
|
32
|
-
end
|
33
|
-
|
34
|
-
if defined?(Rails)
|
35
|
-
require "rails"
|
36
|
-
|
37
|
-
module ActiveArchive
|
38
|
-
class Railtie < ::Rails::Railtie
|
39
|
-
|
40
|
-
initializer "active_archive" do |app|
|
41
|
-
ActiveArchive::Railtie.instance_eval do
|
42
|
-
[app.config.i18n.available_locales].flatten.each do |locale|
|
43
|
-
(I18n.load_path << path(locale)) if File.file?(path(locale))
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
protected
|
49
|
-
|
50
|
-
def self.path(locale)
|
51
|
-
File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
1
|
+
require 'rails'
|
2
|
+
require 'active_archive/version'
|
3
|
+
require 'active_archive/railtie'
|
4
|
+
require 'active_archive/settings'
|
5
|
+
require 'active_archive/table_definition'
|
6
|
+
require 'active_archive/methods'
|
7
|
+
require 'active_archive/scopes'
|
8
|
+
require 'active_archive/base'
|
9
|
+
require 'generators/active_archive/install_generator'
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require 'rails/generators'
|
2
2
|
|
3
3
|
module ActiveArchive
|
4
4
|
class InstallGenerator < Rails::Generators::Base
|
5
|
-
source_root File.expand_path(
|
5
|
+
source_root File.expand_path('../templates', __FILE__)
|
6
6
|
|
7
7
|
def copy_initializer_file
|
8
|
-
copy_file(
|
8
|
+
copy_file('install.rb', 'config/initializers/active_archive.rb')
|
9
9
|
end
|
10
10
|
|
11
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dry-configurable
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +136,62 @@ dependencies:
|
|
122
136
|
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: fasterer
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: flay
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: reek
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rubocop
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
125
195
|
description: Prevent database records from being destroyed.
|
126
196
|
email:
|
127
197
|
- j.gomez@drexed.com
|
@@ -130,8 +200,12 @@ extensions: []
|
|
130
200
|
extra_rdoc_files: []
|
131
201
|
files:
|
132
202
|
- ".coveralls.yml"
|
203
|
+
- ".fasterer.yml"
|
204
|
+
- ".flayignore"
|
133
205
|
- ".gitignore"
|
206
|
+
- ".reek"
|
134
207
|
- ".rspec"
|
208
|
+
- ".rubocop.yml"
|
135
209
|
- ".travis.yml"
|
136
210
|
- CODE_OF_CONDUCT.md
|
137
211
|
- Gemfile
|
@@ -144,9 +218,10 @@ files:
|
|
144
218
|
- config/locales/en.yml
|
145
219
|
- lib/active_archive.rb
|
146
220
|
- lib/active_archive/base.rb
|
147
|
-
- lib/active_archive/configuration.rb
|
148
221
|
- lib/active_archive/methods.rb
|
222
|
+
- lib/active_archive/railtie.rb
|
149
223
|
- lib/active_archive/scopes.rb
|
224
|
+
- lib/active_archive/settings.rb
|
150
225
|
- lib/active_archive/table_definition.rb
|
151
226
|
- lib/active_archive/version.rb
|
152
227
|
- lib/generators/active_archive/install_generator.rb
|