sanitization 1.1.1 → 1.1.2

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
  SHA256:
3
- metadata.gz: fa296e29509cc55b27d9e5e5881b6e2eb470efa9d2b3b587aed8512853576a9a
4
- data.tar.gz: 2fda3af9d53f634997e8b1146a536212d43bc5cc3d0d8034867704d63f045427
3
+ metadata.gz: ff858e62a80da368c793ce3d2378a2880624afbb96690ee8c28b1c3cb3f22e31
4
+ data.tar.gz: 22e3dc04af69916f11eb3742d8c33e4576f028195e569d9d23bd69da5a471bef
5
5
  SHA512:
6
- metadata.gz: 6c39ba9c58abe38d12fbddefd0b1724e1845bcffd9786c7569374de9eb6ec615c13ff2e030e001bf9d66c92bacc42051070d0be6c812ae315dbe0ecdbe7022d5
7
- data.tar.gz: 94d13c49f4383d5c517285db93f02d853859fa0f3d300131a0ac3280be042ac22daae72d584a3ff70cbf9c7ab6de4fa3d3a0346888f9279153bab2c7eb060a8e
6
+ metadata.gz: 4e3f07dec145727b97aa419b2a08f05909899a61aa0b0f9cc002c68cc0304f84013118b44f502b4c10b25073d048d4b9eb86c554e53f8f346328059d8a249cad
7
+ data.tar.gz: eb9e30c44753de9a8c2cfb569eb24e1b0775885db5a077f637325acfd7166e7323e893587449bba7d8723c6208f51c22c1d999987ec01c4c4b7c9c252dcec1d2
@@ -19,7 +19,7 @@ jobs:
19
19
  runs-on: ubuntu-latest
20
20
  strategy:
21
21
  matrix:
22
- ruby-version: ['2.6', '2.7', '3.0']
22
+ ruby-version: ['2.6', '2.7']
23
23
 
24
24
  steps:
25
25
  - uses: actions/checkout@v2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sanitization (1.1.1)
4
+ sanitization (1.1.2)
5
5
  activerecord
6
6
  activesupport
7
7
 
@@ -11,7 +11,11 @@ module Sanitization
11
11
  private
12
12
  def sanitizes(options = {})
13
13
  # Skip initialization if table is not yet created. For example, during migrations.
14
- return unless ActiveRecord::Base.connection.data_source_exists?(self.table_name)
14
+ begin
15
+ return unless ActiveRecord::Base.connection.data_source_exists?(self.table_name)
16
+ rescue ActiveRecord::NoDatabaseError
17
+ return
18
+ end
15
19
 
16
20
  self.sanitization__store ||= {}
17
21
 
@@ -38,9 +42,13 @@ module Sanitization
38
42
  end
39
43
 
40
44
  if options[:case]
45
+ @valid_case_methods ||= String.new.methods.map { |m|
46
+ m.to_s if m.to_s =~ /case$/
47
+ }.compact
48
+
41
49
  raise ArgumentError.new("Method not found: `:#{options[:case]}`. " +
42
- "Valid methods are: :#{valid_case_methods.join(', :')}") \
43
- unless valid_case_methods.include?(options[:case]) || options[:case] == :none
50
+ "Valid methods are: :#{@valid_case_methods.join(', :')}") \
51
+ unless @valid_case_methods.include?(options[:case]) || options[:case] == :none
44
52
  end
45
53
 
46
54
  columns_to_format.each do |col|
@@ -54,12 +62,6 @@ module Sanitization
54
62
  EOV
55
63
  end
56
64
  alias sanitization sanitizes
57
-
58
- def valid_case_methods
59
- String.new.methods.map { |m|
60
- m.to_s if m.to_s =~ /case$/
61
- }.compact
62
- end
63
65
  end # module ClassMethods
64
66
 
65
67
  module InstanceMethods
@@ -1,3 +1,3 @@
1
1
  module Sanitization
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanitization
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Mercier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-06 00:00:00.000000000 Z
11
+ date: 2021-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.1.4
87
+ rubygems_version: 3.1.2
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: ''