sanitization 1.1.1 → 1.1.2
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/.github/workflows/main.yml +1 -1
- data/Gemfile.lock +1 -1
- data/lib/sanitization/active_record_extension.rb +11 -9
- data/lib/sanitization/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ff858e62a80da368c793ce3d2378a2880624afbb96690ee8c28b1c3cb3f22e31
|
|
4
|
+
data.tar.gz: 22e3dc04af69916f11eb3742d8c33e4576f028195e569d9d23bd69da5a471bef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e3f07dec145727b97aa419b2a08f05909899a61aa0b0f9cc002c68cc0304f84013118b44f502b4c10b25073d048d4b9eb86c554e53f8f346328059d8a249cad
|
|
7
|
+
data.tar.gz: eb9e30c44753de9a8c2cfb569eb24e1b0775885db5a077f637325acfd7166e7323e893587449bba7d8723c6208f51c22c1d999987ec01c4c4b7c9c252dcec1d2
|
data/.github/workflows/main.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -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
|
-
|
|
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
|
data/lib/sanitization/version.rb
CHANGED
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.
|
|
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-
|
|
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.
|
|
87
|
+
rubygems_version: 3.1.2
|
|
88
88
|
signing_key:
|
|
89
89
|
specification_version: 4
|
|
90
90
|
summary: ''
|