effective_addresses 1.2.0 → 1.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
  SHA1:
3
- metadata.gz: b594af8fa2bdd1806be1f1872bdce71eeb59bc46
4
- data.tar.gz: 87e92a8484f53765692e1acefe49668514308a98
3
+ metadata.gz: 17e378e4865984f94eda8717f7b340f1252be831
4
+ data.tar.gz: 3c4a62c3a27ad8cd290eeaabbaaba1bce7ca2481
5
5
  SHA512:
6
- metadata.gz: 3f686364456dfd9245191dba5e36c54fd8d25811b97db347d2b8bb573cf870bf1fd4b72bf6ad36fffc4e59f40d50e39d77e693ba65a67ca03494270228b54c45
7
- data.tar.gz: d46b332d3b12cece623af02aabe72060ac0557887c7b0a06b985fb4651618fffc770a03c4677ef6a4f259b6dd3f539072bd9c313aaf5ab181902713dfb990e66
6
+ metadata.gz: 0eca45f5717436d5e38b270442d7e5b4756a13cc8d4d66ad7df7af8daa46bc24f0b40d19a5a11662c31610aa4fdf9b0c241bceaa686ef66c16c00ac25a6951f8
7
+ data.tar.gz: e3d76cf9ea4fe20908b413f2e5d4c0fb6b57d69d1b26b27b8125a39e53e5bbcea1974adc69fea09a7e33e045ae8da469aebe381b70d86f8f7bfd91b7d175ecd0
@@ -118,7 +118,7 @@ module Effective
118
118
  # An address may be set with a category but nothing else
119
119
  # This is considered empty
120
120
  def empty?
121
- !address1.present? && !address2.present? && !city.present? && !state_code.present? && !country_code.present? && !postal_code.present?
121
+ !address1.present? && !address2.present? && !city.present? && !postal_code.present?
122
122
  end
123
123
 
124
124
  def to_s
@@ -1,6 +1,6 @@
1
1
  class EffectiveAddressValidValidator < ActiveModel::EachValidator
2
2
  def validate_each(record, attribute, value)
3
- if value.present? && value.valid? == false
3
+ if value.present? && !value.empty? && !value.valid?
4
4
  record.errors[attribute] << 'is invalid'
5
5
  end
6
6
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveAddresses
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_addresses
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-10 00:00:00.000000000 Z
11
+ date: 2015-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails