thoth 0.0.7 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/thoth/rails/controller_context.rb +1 -1
- data/lib/thoth/rails/model.rb +7 -1
- data/lib/thoth/version.rb +1 -1
- 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: 783958368567ca3b8bc49e08d8eaa7915d877278
|
4
|
+
data.tar.gz: fb19913e717e4a4ef9f3f180f4f1778b09f68d26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 291f647ab726eeb4f9b61fda95bd0ee0bb6711653e2c94e5b4f7c1afb04cb85abf2c19f789c90cddee1f908c8015f9862e646f1a1233426b03f41d657683f0f4
|
7
|
+
data.tar.gz: 7ce57e9ed66dcdce7056bb014f0c782d99eaf820f05650de197023c890f8ca359ed889d1bed0bcaf2d78dc94d05360d7e209fec959437bb723834d786ced8d63
|
data/README.md
CHANGED
@@ -42,6 +42,7 @@ class Cat < ActiveRecord::Base
|
|
42
42
|
|
43
43
|
# :on (default [:create, :update, :destroy]) - which events should be logged
|
44
44
|
# :only (default all attributes) - for updates, only log when these attributes are changed
|
45
|
+
# :except (default none) - for updates, do not log if only attributes in this list are changed
|
45
46
|
log_events on: [:update, :destroy], only: [:mood, :name]
|
46
47
|
end
|
47
48
|
```
|
data/lib/thoth/rails/model.rb
CHANGED
@@ -30,7 +30,13 @@ module Thoth
|
|
30
30
|
def thoth_log_update
|
31
31
|
return unless self.class.thoth_options[:on].include?(:update)
|
32
32
|
|
33
|
-
|
33
|
+
if except_options.present?
|
34
|
+
except_options = self.class.thoth_options[:except]
|
35
|
+
only_options = self.class.columns.map(&:name) - except_options
|
36
|
+
else
|
37
|
+
only_options = self.class.thoth_options[:only]
|
38
|
+
end
|
39
|
+
|
34
40
|
if only_options.empty? || !(only_options.map(&:to_s) & changes.keys).empty?
|
35
41
|
thoth_log_model(:update)
|
36
42
|
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: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philippe Huibonhoa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|