active_archive 5.1.1 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e79f883ab5825f00ee04650e5122b97d4ea0a6645ed2efa7eb31c1f395a7fab
4
- data.tar.gz: e6d98b9eac6767431d471bb2b2e210b9e165aabb16bb2c2be80e5c3fedfe655a
3
+ metadata.gz: '08222bc6391c9cd704a1d8627e7d917e2ed5402331752535a0c2ff5d6b76faff'
4
+ data.tar.gz: a3282bf77de3bde223270000706fba2efae8cc71f0b2c3f36263277e78e422de
5
5
  SHA512:
6
- metadata.gz: 050b2975d6e1a418647a6bad987176a5fc3700d9d96a5ce3d98d23cd21987813bcc26542ae7c45f7d36a1b1fd11edd5534fd78c89ef7423a7eb41639578151a6
7
- data.tar.gz: 84f049762db5b11c6e45dd3ce1f4f8f96c4265e6bf8368930804d816ddeca11e64a7ffd62a4f4b0b5107ced2eb64aec3c0c38bfdbe4a66cac1d492ed5e41cba0
6
+ metadata.gz: 400646baead28fcc9bd490d73a7a8debc4c00b5d57a92e6b874bb28c4a25eb49e4f9dbe6f8d6902e5f91f613aa2d20ac19c75e7fae0661b71dcffea6c871f1ce
7
+ data.tar.gz: 1dc8bd1ae2ccbe9e00417d2bcf2360ae97403b61b667584de45bc0b7a0ebd631cc4ddb4b96d03ad154e0342174d1bb9f3b84c535af9577e289b53690ccbd6201
@@ -179,7 +179,12 @@ module ActiveArchive
179
179
  begin
180
180
  should_ignore_validations?(force) ? record.save(validate: false) : record.save!
181
181
 
182
- @previous_mutation_tracker = record.try(:previous_mutation_tracker)
182
+ if ::ActiveRecord::VERSION::MAJOR >= 5
183
+ @previous_mutation_tracker = record.send(:previous_mutation_tracker)
184
+ elsif ::ActiveRecord::VERSION::MAJOR >= 4
185
+ @previously_changed = record.instance_variable_get('@previously_changed')
186
+ end
187
+
183
188
  @changed_attributes = HashWithIndifferentAccess.new
184
189
  @attributes = record.instance_variable_get('@attributes')
185
190
  @mutation_tracker = nil
@@ -214,4 +219,6 @@ module ActiveArchive
214
219
  end
215
220
  end
216
221
 
217
- ActiveRecord::Base.include(ActiveArchive::Base)
222
+ ActiveSupport.on_load(:active_record) do
223
+ ActiveRecord::Base.send :include, ActiveArchive::Base
224
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveArchive
4
- VERSION ||= '5.1.1'
4
+ VERSION ||= '5.1.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_archive
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1
4
+ version: 5.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez