html_terminator 6.0.1 → 6.1.0

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
  SHA256:
3
- metadata.gz: 9a7a8946175692f847d9c8b647ff9eb519813406b5a5994a00c979404e20c777
4
- data.tar.gz: ca19d579c5f12681c65d07663a538016651c4927b70365c29fabd0a05a13e7ed
3
+ metadata.gz: 98d8ed2ca96a3b39e0ad1cc1c9b04741fca98dd5dc49b47aae6bc35dbcaaf9e2
4
+ data.tar.gz: 508007abd9d186b41757bcdd71f74fdaedbc39f67a00f73dabbdf79313540fa8
5
5
  SHA512:
6
- metadata.gz: acc02f9bc1eb2811f1247f85b2c01b89f56374dd5fa8bcb7db22c10cdc2261a75d90c747c8c04db71ba535997b3b0dce5ddb8388baf136cc14f8c38fb6930b1a
7
- data.tar.gz: d7c4a6e1e5ccce26db2b603325290ab324133896a9ca6d0566d8ed8ea42f72b55fab34d2d0c8a8eaf5ded653a1163e08b70b87f13aae39849d6378c35ec4ef19
6
+ metadata.gz: 18714e4936b0341dae0154715c1996c49d5a5a09c02a6ae54a2ed1e985f6df50a86871683e9fb0f73c588f529e44ad73e8bf325bec4db83423d024a3cd431f23
7
+ data.tar.gz: d210292b465e5528a2c5f7d529e92defdb6ae4d1adae88ba53d043be3a29e246e9c0fdbebad022c4266225c27506dd15247f126bde51b295b7d5edc8bb6a79f5
@@ -1,3 +1,3 @@
1
1
  module HtmlTerminator
2
- VERSION = '6.0.1'
2
+ VERSION = '6.1.0'
3
3
  end
@@ -29,37 +29,30 @@ module HtmlTerminator
29
29
  end
30
30
 
31
31
  def terminate_html(*args)
32
- # Table may not exist yet when schema is initially getting loaded
33
- if self.table_exists?
34
- # object key/value of field => options
35
- unless method_defined?(:html_terminator_fields)
36
- class_attribute :html_terminator_fields
37
- self.html_terminator_fields = {}
38
- end
39
-
40
- options = args.extract_options!
41
- options = SANITIZE_OPTIONS.clone.merge(options)
32
+ # object key/value of field => options
33
+ unless method_defined?(:html_terminator_fields)
34
+ class_attribute :html_terminator_fields
35
+ self.html_terminator_fields = {}
36
+ end
42
37
 
43
- valid_fields = self.fields & args
38
+ options = args.extract_options!
39
+ options = SANITIZE_OPTIONS.clone.merge(options)
44
40
 
45
- valid_fields.each do |field|
46
- self.html_terminator_fields[field] = options.deep_dup
47
- end
41
+ args.each do |field|
42
+ self.html_terminator_fields[field] = options.deep_dup
43
+ end
48
44
 
49
- unless self.html_terminator_fields.empty?
50
- before_validation :terminate_html
45
+ unless self.html_terminator_fields.empty?
46
+ before_validation :terminate_html
51
47
 
52
- # sanitize reads
53
- valid_fields.each do |attr|
54
- define_method(attr) do |*rargs|
55
- # sanitize it
56
- HtmlTerminator.sanitize super(*rargs), options
57
- end
48
+ # sanitize reads
49
+ args.each do |attr|
50
+ define_method(attr) do |*rargs|
51
+ # sanitize it
52
+ HtmlTerminator.sanitize super(*rargs), options
58
53
  end
59
54
  end
60
55
  end
61
- rescue ActiveRecord::ConnectionNotEstablished
62
- # Treat as if the table doesn't exist
63
56
  end
64
57
  end
65
58
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_terminator
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steel Fu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-11-12 00:00:00.000000000 Z
12
+ date: 2021-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler