thoth 0.0.3 → 0.0.5
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/thoth/rails/model.rb +5 -2
- data/lib/thoth/version.rb +1 -1
- data/spec/thoth/rails/model_spec.rb +1 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0000db184af4569ae95d163593b0f8322b8cb33d
|
|
4
|
+
data.tar.gz: 2b9d8355cb4251d21f5706d43d32e6bed570f466
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 12ab6cf840a1c03d37f88eb6039b5e72bfc17f196b34f67bd08d6600e905957e70c406224fcb526fb2d3f00c97b9a94f4dec2aa84db06a1ed4b6c747902f5d04
|
|
7
|
+
data.tar.gz: 49e779d7500edf48fc828dfa6da49f1bf361af9736f225a30ab9e2955b92218594827892f11ae096a41e4949adf34cce23f64efd45de8f0cddaadc9c863d1efe
|
data/lib/thoth/rails/model.rb
CHANGED
|
@@ -23,18 +23,21 @@ module Thoth
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def thoth_log_create
|
|
26
|
+
return unless self.class.thoth_options[:on].include?(:create)
|
|
26
27
|
thoth_log_model(:create)
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
def thoth_log_update
|
|
30
|
-
|
|
31
|
+
return unless self.class.thoth_options[:on].include?(:update)
|
|
31
32
|
|
|
33
|
+
only_options = self.class.thoth_options[:only]
|
|
32
34
|
if only_options.empty? || !(only_options.map(&:to_s) & changes.keys).empty?
|
|
33
35
|
thoth_log_model(:update)
|
|
34
36
|
end
|
|
35
37
|
end
|
|
36
38
|
|
|
37
39
|
def thoth_log_destroy
|
|
40
|
+
return unless self.class.thoth_options[:on].include?(:destroy)
|
|
38
41
|
thoth_log_model(:destroy)
|
|
39
42
|
end
|
|
40
43
|
|
|
@@ -42,4 +45,4 @@ module Thoth
|
|
|
42
45
|
Thoth.logger.log("#{self.class.name} #{action}", changes: changes, attributes: attributes)
|
|
43
46
|
end
|
|
44
47
|
end
|
|
45
|
-
end
|
|
48
|
+
end
|
data/lib/thoth/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: thoth
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Philippe Huibonhoa
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|