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 +4 -4
- data/lib/active_archive/base.rb +9 -2
- 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: '08222bc6391c9cd704a1d8627e7d917e2ed5402331752535a0c2ff5d6b76faff'
|
4
|
+
data.tar.gz: a3282bf77de3bde223270000706fba2efae8cc71f0b2c3f36263277e78e422de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 400646baead28fcc9bd490d73a7a8debc4c00b5d57a92e6b874bb28c4a25eb49e4f9dbe6f8d6902e5f91f613aa2d20ac19c75e7fae0661b71dcffea6c871f1ce
|
7
|
+
data.tar.gz: 1dc8bd1ae2ccbe9e00417d2bcf2360ae97403b61b667584de45bc0b7a0ebd631cc4ddb4b96d03ad154e0342174d1bb9f3b84c535af9577e289b53690ccbd6201
|
data/lib/active_archive/base.rb
CHANGED
@@ -179,7 +179,12 @@ module ActiveArchive
|
|
179
179
|
begin
|
180
180
|
should_ignore_validations?(force) ? record.save(validate: false) : record.save!
|
181
181
|
|
182
|
-
|
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
|
-
|
222
|
+
ActiveSupport.on_load(:active_record) do
|
223
|
+
ActiveRecord::Base.send :include, ActiveArchive::Base
|
224
|
+
end
|