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 +4 -4
- data/lib/active_archive/base.rb +15 -4
- data/lib/active_archive/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 072ed65a31062a4db0c88627cb8f9022480a6c7d068ad782394afad632c6f35d
|
4
|
+
data.tar.gz: 18f91cd29db6311a8b294cabeb64fd5058aef1c3e4b695426f85a26bf29b126f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 761e73ab87cf0d2956f5b7ce12b36e2017d1e50931782fa922bf627d3f8c4d719090a5a9c16aa1449de19f2dcd28e1de7fc2b318375e9c70d9c0aac6eaff75ed
|
7
|
+
data.tar.gz: 013bdda8bbe05ef240538a314dd1c96d4a72f9380fada9763a7b56e02c5acb234a4284a2e22b4ff71f9cd403e6e018ce307cb3f30d3c4b2a112529d0f8a52187
|
data/lib/active_archive/base.rb
CHANGED
@@ -179,10 +179,21 @@ module ActiveArchive
|
|
179
179
|
begin
|
180
180
|
should_ignore_validations?(force) ? record.save(validate: false) : record.save!
|
181
181
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
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)
|