thoth 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 783958368567ca3b8bc49e08d8eaa7915d877278
4
- data.tar.gz: fb19913e717e4a4ef9f3f180f4f1778b09f68d26
3
+ metadata.gz: 36a0fea0a7c3866ead79fbc02e70ff5ae5002e3b
4
+ data.tar.gz: a2f1581036daafdf21c24d981059e40be9bc2702
5
5
  SHA512:
6
- metadata.gz: 291f647ab726eeb4f9b61fda95bd0ee0bb6711653e2c94e5b4f7c1afb04cb85abf2c19f789c90cddee1f908c8015f9862e646f1a1233426b03f41d657683f0f4
7
- data.tar.gz: 7ce57e9ed66dcdce7056bb014f0c782d99eaf820f05650de197023c890f8ca359ed889d1bed0bcaf2d78dc94d05360d7e209fec959437bb723834d786ced8d63
6
+ metadata.gz: 3ecb32050cca7bd0cc0e57ff4fdc4367e8833424976bb0d700ae0666be860733611d2b98a7417315eabb1fb669928c158966c95b9f3b5e4e3fe3d9c9c236ff72
7
+ data.tar.gz: 22bbef5466d1b538531df83eb3e0a7ea6b09e586acba72802f2fef4b5c87ba0dd2f111b04422b1ab00f58731b633583691b9c7d59e4f5ca5d3932505dc3c424e
@@ -13,7 +13,12 @@ module Thoth
13
13
  end
14
14
 
15
15
  def thoth_request_context
16
- context = params.to_h
16
+ #>= Rails 4.2
17
+ if ::Rails::VERSION::MAJOR >= 5 || (::Rails::VERSION::MAJOR == 4 && ::Rails::VERSION::MINOR >= 2)
18
+ context = params.to_unsafe_h
19
+ else
20
+ context = params.to_h
21
+ end
17
22
  context[:current_user] = current_user.try(:id) if defined?(current_user)
18
23
  context
19
24
  end
@@ -30,11 +30,11 @@ module Thoth
30
30
  def thoth_log_update
31
31
  return unless self.class.thoth_options[:on].include?(:update)
32
32
 
33
- if except_options.present?
34
- except_options = self.class.thoth_options[:except]
35
- only_options = self.class.columns.map(&:name) - except_options
33
+ except_options = self.class.thoth_options[:except]
34
+ only_options = if except_options.present?
35
+ self.class.columns.map(&:name) - except_options.map(&:to_s)
36
36
  else
37
- only_options = self.class.thoth_options[:only]
37
+ self.class.thoth_options[:only]
38
38
  end
39
39
 
40
40
  if only_options.empty? || !(only_options.map(&:to_s) & changes.keys).empty?
data/lib/thoth/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Thoth
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philippe Huibonhoa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-09 00:00:00.000000000 Z
11
+ date: 2017-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport