active_archive 6.0.0 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbe2d37d4d70cc6930e4b7fea4f2248418375434cd4d7a704327214e61b36eb5
4
- data.tar.gz: 44bcde3d05e859deaf2839356c2c13258fe73f47225177587777f1ca18483400
3
+ metadata.gz: 2bbfa9b4c8c5cd87c6ff40b24b518b98577b87fd29004743a2afc78f7652518f
4
+ data.tar.gz: e28cfa87887246ca30a40030a4d0dbbbf7e93feabdaf17a42beba92fd9d98920
5
5
  SHA512:
6
- metadata.gz: 711465df49e3c0f94edc7d0db2231ef2c2dda02f41cb494e6b78de4b2b5ccda7efb73156fc81f322c67359d4f2a7c9568ee00447951bbdf2683b1d209192358b
7
- data.tar.gz: 849e0c7fed67835e44a7d54213c39fb3793001e5b2531c380ed370bf4ee073d7a0fac7bd5d67640c05c6616186cbfdf6c505357ed4b6aae6d82978fefea8f93d
6
+ metadata.gz: 1fdcf813a2d5de19baac112173e3e54c8ec0c4189000a088535d887e42472de12c5fb0f063d29d22985a2c6000c8ad578119041f9b0c076d266229640ee99362
7
+ data.tar.gz: c973b47fb5654d137c070ab6f91efcb7baa4328d555097cffc25a4aad35931aac7f64bbd29fd0498f19b631c19b42f7751146b50ff1ca4fb38ffcaf984f2092d
@@ -1,7 +1,7 @@
1
1
  AllCops:
2
2
  DisplayCopNames: true
3
3
  DisplayStyleGuide: true
4
- TargetRubyVersion: 2.4
4
+ TargetRubyVersion: 2.5
5
5
  Exclude:
6
6
  - 'spec/**/**/*'
7
7
  Layout/EmptyLinesAroundBlockBody:
@@ -1,13 +1,13 @@
1
- before_install:
2
- - sudo apt-get install libxml2-dev
3
- cache: bundler
1
+ sudo: false
4
2
  language: ruby
5
- notifications:
6
- email:
7
- recipients:
8
- - j.gomez@drexed.com
9
- on_failure: change
10
- on_success: never
11
3
  rvm:
12
4
  - ruby-head
13
- script: 'bundle exec rake'
5
+ before_install:
6
+ - sudo apt-get install libxml2-dev
7
+ - gem update --system
8
+ - gem install bundler
9
+ - bundle install
10
+ script:
11
+ - bundle exec rake
12
+ notifications:
13
+ disable: true
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  ActiveArchive is a library for preventing database records from being destroyed.
7
7
 
8
- **NOTE: version >= '6.0.0' has a small breaking change with the timestamp key and initializer file.**
8
+ **NOTE: version >= '6.0.0' has a breaking change with the migration timestamps, initializer options, and model/record callbacks.**
9
9
 
10
10
  ## Installation
11
11
 
@@ -29,10 +29,11 @@ Or install it yourself as:
29
29
  * [Usage](#usage)
30
30
  * [Methods](#methods)
31
31
  * [Scopes](#scopes)
32
+ * [Callbacks](#callbacks)
32
33
 
33
34
  ## Configurations
34
35
 
35
- `rails generate active_archive:install` will generate the following file:
36
+ `rails g active_archive:install` will generate the following file:
36
37
  `../config/initalizers/active_archive.rb`
37
38
 
38
39
  ```ruby
@@ -91,6 +92,14 @@ User.archived.all #=> returns only archived record
91
92
  User.unarchived.all #=> returns only unarchived record
92
93
  ```
93
94
 
95
+ ## Callbacks
96
+
97
+ **Options:**
98
+ * `before_archive`
99
+ * `before_unarchived`
100
+ * `after_archive`
101
+ * `after_unarchive`
102
+
94
103
  ## Contributing
95
104
 
96
105
  Your contribution is welcome.
@@ -83,6 +83,7 @@ module ActiveArchive
83
83
  save(validate: false)
84
84
  end
85
85
 
86
+ # rubocop:disable Metrics/CyclomaticComplexity
86
87
  def mark_relections_as_archived
87
88
  self.class.reflections.each do |table_name, reflection|
88
89
  next unless dependent_destroy?(reflection)
@@ -100,6 +101,7 @@ module ActiveArchive
100
101
  dependents.send(action)
101
102
  end
102
103
  end
104
+ # rubocop:enable Metrics/CyclomaticComplexity
103
105
 
104
106
  def mark_relections_as_unarchived
105
107
  self.class.reflections.each do |table_name, reflection|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveArchive
4
- VERSION ||= '6.0.0'
4
+ VERSION ||= '6.0.1'
5
5
  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: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-18 00:00:00.000000000 Z
11
+ date: 2018-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails