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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b2793ea2d6f7ba6cca8d754aab13a953ccdc2b1
4
- data.tar.gz: 12b537879e1e3093dfe2c00fdc77b84558715565
3
+ metadata.gz: 0000db184af4569ae95d163593b0f8322b8cb33d
4
+ data.tar.gz: 2b9d8355cb4251d21f5706d43d32e6bed570f466
5
5
  SHA512:
6
- metadata.gz: 330fc761080f3a524cea64801b068bd38aa80864804cb435cbf150c30f6bfc2624e0d339106c025094da412da8de659a944cecb1ea94a51be127d64bcb9b943e
7
- data.tar.gz: 0fab81f05ccbd9303f2057065c003a648d4c2f7120aa08ca23edde4edd294d4e5526b4dce964eff5910026b1c3f38085e4448f6b755af38f3b185db156d3baeb
6
+ metadata.gz: 12ab6cf840a1c03d37f88eb6039b5e72bfc17f196b34f67bd08d6600e905957e70c406224fcb526fb2d3f00c97b9a94f4dec2aa84db06a1ed4b6c747902f5d04
7
+ data.tar.gz: 49e779d7500edf48fc828dfa6da49f1bf361af9736f225a30ab9e2955b92218594827892f11ae096a41e4949adf34cce23f64efd45de8f0cddaadc9c863d1efe
@@ -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
- only_options = self.class.thoth_options[:only]
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
@@ -1,3 +1,3 @@
1
1
  module Thoth
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -29,7 +29,6 @@ describe Thoth::Rails::Model do
29
29
  Cat.create!
30
30
  end
31
31
  end
32
-
33
32
  end
34
33
 
35
34
  context "on destroy" do
@@ -101,5 +100,4 @@ describe Thoth::Rails::Model do
101
100
  end
102
101
  end
103
102
  end
104
-
105
- end
103
+ end
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.3
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-01-07 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport