missing_validators 0.8.1 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67f9b58893a8c167a94a3b276423e5e8cf2ea3aa
4
- data.tar.gz: 97fd021d996e9babd6873a3bd54f879b741b5e84
3
+ metadata.gz: 28a7af981a1a7fdb56740a472e9ece734cc2246d
4
+ data.tar.gz: 76aa9c1a9ada749f079041f2f6fa8f09e09151ca
5
5
  SHA512:
6
- metadata.gz: 9e795fb8ddab0d9e351c1d2c468c7533742aab1e29b2782bacbf3b257459fda3736a54d1ab9b2af55aef9652efa42488fbffc8577cf03ddd9b10e47562971a91
7
- data.tar.gz: 754ee91ef841090fa4088a1653d051ef80103c432495d3f41163bdd926767221cdaa3e9fa501d983c530b0759ad78ee6e9d5af8e580ce010c96510aa5fee5e7a
6
+ metadata.gz: 23ed45c14ba0c9339194e9e0ac9c143903dc07ef275fd8a59e54ce3e4787fa7054e3d99d5b655dc4b48ab5dfd3d442b0f5b3b6e7f56b91e1ce7807252c322a0d
7
+ data.tar.gz: 57d9ac4dd04bc1a57f54139cad40a70fe8584aadd3a7674509e66c697c09775f646d0f436d4092a0a70f4987096f9a27e3f5d2fca004664c9eb1bb673f33b4a0
@@ -23,7 +23,7 @@ class LatitudeValidator < ActiveModel::EachValidator
23
23
  private
24
24
 
25
25
  def self.valid?(latitude, options)
26
- latitude >= -90 && latitude <= 90
26
+ latitude.present? && latitude >= -90 && latitude <= 90
27
27
  end
28
28
 
29
29
  end
@@ -23,7 +23,7 @@ class LongitudeValidator < ActiveModel::EachValidator
23
23
  private
24
24
 
25
25
  def self.valid?(longitude, options)
26
- longitude >= -180 && longitude <= 180
26
+ longitude.present? && longitude >= -180 && longitude <= 180
27
27
  end
28
28
 
29
29
  end
@@ -1,5 +1,5 @@
1
1
  # Provides a collection of custom validators that are often required in Rails applications.
2
2
  module MissingValidators
3
3
  # Gem version.
4
- VERSION = "0.8.1"
4
+ VERSION = "0.8.2"
5
5
  end
@@ -19,5 +19,8 @@ describe LatitudeValidator do
19
19
 
20
20
  it { should_not allow_value(-90.1).for(:lat) }
21
21
  it { should_not allow_value(90.1).for(:lat) }
22
+
23
+ it { should_not allow_value(nil).for(:lat) }
24
+ it { should_not allow_value('').for(:lat) }
22
25
  end
23
26
  end
@@ -19,5 +19,8 @@ describe LongitudeValidator do
19
19
 
20
20
  it { should_not allow_value(-181.1).for(:lon) }
21
21
  it { should_not allow_value(181.1).for(:lon) }
22
+
23
+ it { should_not allow_value(nil).for(:lon) }
24
+ it { should_not allow_value('').for(:lon) }
22
25
  end
23
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: missing_validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Gridnev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-24 00:00:00.000000000 Z
11
+ date: 2014-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec