historiographer 4.1.10 → 4.1.11
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/historiographer/version.rb +1 -1
- data/lib/historiographer.rb +2 -18
- 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: 8fe44573149356e074266299cc5da74332d9bc137b577a80f6f09baea0209b2d
|
|
4
|
+
data.tar.gz: 36f1c1cda4de8385138642d0d70e410436f91052104af85190ac41b973cb485d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2fc75dbf8c2826cf7d4df25dc07c0f37b1fccbe0eccc9a1d141302b56b50a779510c92cccb1bc28ecb2bfe15714692576041de50db355cb2d794a6dd33b5daaf
|
|
7
|
+
data.tar.gz: cdbdecee2374394077f575df397ff2b3bee3b8c38a9b0ab17642ac924efd83d63b524b9c9a52e19721c5ef90f7f1d0c8c575084e8259439d21db878a4e27e097
|
data/lib/historiographer.rb
CHANGED
|
@@ -105,7 +105,7 @@ module Historiographer
|
|
|
105
105
|
history_user_absent_action if history_user_id.nil?
|
|
106
106
|
|
|
107
107
|
current_history = histories.where(history_ended_at: nil).order('id desc').limit(1).last
|
|
108
|
-
current_history.
|
|
108
|
+
current_history.update_columns(history_ended_at: UTC.now) if current_history.present?
|
|
109
109
|
|
|
110
110
|
if respond_to?(:paranoia_destroy)
|
|
111
111
|
self.history_user_id = history_user_id
|
|
@@ -115,6 +115,7 @@ module Historiographer
|
|
|
115
115
|
destroy_without_history
|
|
116
116
|
@no_history = false
|
|
117
117
|
end
|
|
118
|
+
true
|
|
118
119
|
end
|
|
119
120
|
|
|
120
121
|
alias_method :destroy, :destroy_with_history
|
|
@@ -366,23 +367,6 @@ module Historiographer
|
|
|
366
367
|
raise HistoryUserIdMissingError, 'history_user_id must be passed in order to save record with histories! If you are in a context with no history_user_id, explicitly call #save_without_user'
|
|
367
368
|
end
|
|
368
369
|
|
|
369
|
-
def list_callbacks(klass)
|
|
370
|
-
callbacks = {}
|
|
371
|
-
|
|
372
|
-
[:create, :update, :save, :destroy, :validation].each do |callback_type|
|
|
373
|
-
chain = klass.send("_#{callback_type}_callbacks")
|
|
374
|
-
callbacks[callback_type] = chain.map do |callback|
|
|
375
|
-
{
|
|
376
|
-
name: callback.filter,
|
|
377
|
-
kind: callback.kind,
|
|
378
|
-
options: callback.options
|
|
379
|
-
}
|
|
380
|
-
end
|
|
381
|
-
end
|
|
382
|
-
|
|
383
|
-
callbacks
|
|
384
|
-
end
|
|
385
|
-
|
|
386
370
|
#
|
|
387
371
|
# Save a record of the most recent changes, with the current
|
|
388
372
|
# time as history_started_at, and the provided user as history_user_id.
|