active_archive 5.1.4 → 5.1.5

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: f72c28452f7441aedc27f28d2460a577f638a4bbcd06a83a8b46646f85f5932e
4
- data.tar.gz: c252bb0a46fc3067312a6c2f90d02f76e0632cd6af7bd42df4dc3742adcf793c
3
+ metadata.gz: 072ed65a31062a4db0c88627cb8f9022480a6c7d068ad782394afad632c6f35d
4
+ data.tar.gz: 18f91cd29db6311a8b294cabeb64fd5058aef1c3e4b695426f85a26bf29b126f
5
5
  SHA512:
6
- metadata.gz: 10778cff2281648bd44e5c6b5de334c27d2619569fc5bdd131d384f228dae9d2220cffeae3585f437dd76ef919112f711d1fa31a4d793730a329568d6ca08e52
7
- data.tar.gz: 4e9654250855ccb8dc415f27a0d10f683acc7363fb52184e998798c16a64a6858877697ee52c7feb05e8eef5bd0691b71d0f955856651022271c46ff2f0da2b3
6
+ metadata.gz: 761e73ab87cf0d2956f5b7ce12b36e2017d1e50931782fa922bf627d3f8c4d719090a5a9c16aa1449de19f2dcd28e1de7fc2b318375e9c70d9c0aac6eaff75ed
7
+ data.tar.gz: 013bdda8bbe05ef240538a314dd1c96d4a72f9380fada9763a7b56e02c5acb234a4284a2e22b4ff71f9cd403e6e018ce307cb3f30d3c4b2a112529d0f8a52187
@@ -179,10 +179,21 @@ module ActiveArchive
179
179
  begin
180
180
  should_ignore_validations?(force) ? record.save(validate: false) : record.save!
181
181
 
182
- @previously_changed = record.instance_variable_get('@previously_changed')
183
- @changed_attributes = HashWithIndifferentAccess.new
184
- @attributes = record.instance_variable_get('@attributes')
185
- @mutation_tracker = nil
182
+ if ::ActiveRecord::VERSION::MAJOR >= 5 && ::ActiveRecord::VERSION::MINOR >= 2
183
+ @mutations_before_last_save = record.send(:mutations_before_last_save)
184
+ @attributes_changed_by_setter = HashWithIndifferentAccess.new
185
+ @attributes = record.instance_variable_get('@attributes') || record.changes
186
+ @mutations_from_database = nil
187
+ elsif ::ActiveRecord::VERSION::MAJOR >= 5
188
+ @previous_mutation_tracker = record.send(:previous_mutation_tracker)
189
+ @changed_attributes = HashWithIndifferentAccess.new
190
+ @attributes = record.instance_variable_get('@attributes') || record.changes
191
+ @mutation_tracker = nil
192
+ elsif ::ActiveRecord::VERSION::MAJOR >= 4
193
+ @previously_changed = record.instance_variable_get('@previously_changed') || record.changes
194
+ @attributes = record.instance_variable_get('@attributes')
195
+ @mutation_tracker = nil
196
+ end
186
197
  rescue => error
187
198
  record.destroy
188
199
  raise(error)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveArchive
4
- VERSION ||= '5.1.4'
4
+ VERSION ||= '5.1.5'
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.4
4
+ version: 5.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez