validators 3.2.0 → 3.2.1

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: a9866f3a757a7bc59c1ea77da0ad9bd8f6c375f7caad128c0abcecfb596ed56a
4
- data.tar.gz: d4e52e82630413c929e5c007ae31dd7667c128ec8201850546d8ba331148b5ed
3
+ metadata.gz: 6e2c068d28878c6cd22e62c6842ed48300e66edf545693b97e08fb6e8ed01d53
4
+ data.tar.gz: 95b90e034d61f65ceb1a1538f906266f882b35d2ca8438b5186ea5caba2f9b6c
5
5
  SHA512:
6
- metadata.gz: 11b91772a301abd780957d7697f75bc41da64a43ef6a55d2a38a298522571f9117b9cec1ac1403b0cf9e56e825e3cd1dc7dac3471ca77ab6823790f2c0d96c84
7
- data.tar.gz: 2cafe7d2fc93d7ca8e26d0317857b959ca9070f6240f5b74e27e9c8b4706b9f727d7a18ebf3a610579d20ee7d617637b1896686609f23e332c2914c0a4378320
6
+ metadata.gz: d85e1a89b5b106d7b1e69809f7a314f001ada7e68416a74d8a08a3875bacd55c6634d02792ac53fe418c63a41253ea3787f2ff5bc257309c01c1cdbb07c07bcf
7
+ data.tar.gz: a12a716b4960cf40fd37f23ff0d049fe2c5efca3dc310c65c96e24d0a5c714c54c7426cb8170ce7ba45023d6367714833e61462db5c97bc6751774b946194d3e
@@ -7,6 +7,8 @@ module ActiveModel
7
7
  return if value.blank? && options[:allow_blank]
8
8
  return if value.nil? && options[:allow_nil]
9
9
 
10
+ value = value.to_s
11
+
10
12
  validate_reserved_subdomain(record, attribute, value)
11
13
  validate_format(record, attribute, value)
12
14
  end
@@ -4,7 +4,7 @@ module Validators
4
4
  module Version
5
5
  MAJOR = 3
6
6
  MINOR = 2
7
- PATCH = 0
7
+ PATCH = 1
8
8
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
9
9
  end
10
10
  end
@@ -3,6 +3,18 @@
3
3
  require "test_helper"
4
4
 
5
5
  class ValidatesSubdomainTest < Minitest::Test
6
+ test "don't explode with nil values" do
7
+ model = build_model do
8
+ attr_accessor :subdomain
9
+ validates_subdomain :subdomain
10
+ end
11
+
12
+ instance = model.new(subdomain: nil)
13
+
14
+ refute instance.valid?
15
+ assert_includes instance.errors[:subdomain], "is invalid"
16
+ end
17
+
6
18
  test "rejects invalid subdomain" do
7
19
  model = build_model do
8
20
  attr_accessor :subdomain
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira