effective_logging 1.5.8 → 1.5.9
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c56031f528265bd29b5ad3e5a6777f87c15275a1
|
4
|
+
data.tar.gz: 9dd9730ea1237141d1ef8772928c65317fdf21ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ec3e3de1a369e7d40d5974b605032bd495ccc465519adfed4b6ff22d8a4350b12f4844ab5af6d2c86aa8ed9703fe2aa8f69ce289ef21d6860e761650e47b650
|
7
|
+
data.tar.gz: e1416af20d48313956c5e1adb4db2be10105f76af08149458cfa57b77216d7dadede1776225f99e75f4817d93ad99e827fbeefedc0fee9ca9990000ba0368b97
|
data/README.md
CHANGED
@@ -16,8 +16,9 @@ module ActsAsLoggable
|
|
16
16
|
included do
|
17
17
|
has_many :logged_changes, -> { where(status: EffectiveLogging.log_changes_status) }, as: :associated, class_name: Effective::Log
|
18
18
|
|
19
|
-
|
19
|
+
around_save do |_, block|
|
20
20
|
@acts_as_loggable_new_record = new_record?
|
21
|
+
block.call
|
21
22
|
EffectiveLogging::ActiveRecordLogger.new(self, log_changes_options).changed! unless @acts_as_loggable_new_record
|
22
23
|
true
|
23
24
|
end
|
@@ -63,7 +63,7 @@ module EffectiveLogging
|
|
63
63
|
(resource.class.try(:reflect_on_all_autosave_associations) || []).each do |association|
|
64
64
|
child_name = association.name.to_s.singularize.titleize
|
65
65
|
|
66
|
-
resource.send(association.name).each_with_index do |child, index|
|
66
|
+
Array(resource.send(association.name)).each_with_index do |child, index|
|
67
67
|
ActiveRecordLogger.new(child, options.merge(logger: logger, depth: (depth + 1), prefix: "#{child_name} ##{index+1}: ")).execute!
|
68
68
|
end
|
69
69
|
end
|
@@ -86,7 +86,7 @@ module EffectiveLogging
|
|
86
86
|
(resource.class.try(:reflect_on_all_autosave_associations) || []).each do |association|
|
87
87
|
attributes[association.name] = {}
|
88
88
|
|
89
|
-
resource.send(association.name).each_with_index do |child, index|
|
89
|
+
Array(resource.send(association.name)).each_with_index do |child, index|
|
90
90
|
attributes[association.name][index+1] = ActiveRecordLogger.new(child, options.merge(logger: logger)).attributes
|
91
91
|
end
|
92
92
|
end
|
@@ -125,7 +125,7 @@ module EffectiveLogging
|
|
125
125
|
elsif options[:except].present?
|
126
126
|
attributes.except(*options[:except])
|
127
127
|
else
|
128
|
-
attributes
|
128
|
+
attributes.except(:updated_at, :created_at)
|
129
129
|
end
|
130
130
|
|
131
131
|
(options[:additionally] || []).each do |attribute|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|