effective_addresses 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ade1e6d3f8bf4f00965f7a1c3c98971538ed7b7e
4
- data.tar.gz: 26251527f1b9a46efe20d0756b7c9eeb6cbc5c8b
3
+ metadata.gz: 040257bf768402e6145101e420df24f063c5a8c3
4
+ data.tar.gz: 0ee1ac756cf2119af9408f88517b5e630e361316
5
5
  SHA512:
6
- metadata.gz: 72e935a846ef87ea09701d19bf05f191929d745a8d76cab0fca80e2e7f8b29ec03eb51e1a545900090ec5dea63aa00909d020b23ec6dea27c02abeb33be31939
7
- data.tar.gz: 5a0ce0fdbc852880d554512eab90177ab177926cb077ea69931e5c6f463c49ff4f6bfd56b2440054feac6c3e7020e8bf0be71f8c77ba394c395ff8feb5faff5b
6
+ metadata.gz: ffcafceb79f86ecd54d39123eee62280af339dffb3103c35b8df8e9573130c5169894bb1e2f417908cbbadaeaaf8c5853d7f24239edcbb76fb8e45f52b5187bd
7
+ data.tar.gz: 44442cbfb9cee3de8ac731bb212a9a940609c364578f03bee7f5049e184e1d5e272e69fbe1e4e8f55c7063c3b57b17193ba348d04906715c13385a0affc98173
@@ -7,9 +7,8 @@ module Effective
7
7
 
8
8
  belongs_to :addressable, :polymorphic => true, :touch => true
9
9
 
10
- validates_presence_of :category, :address1, :city, :country_code, :postal_code
11
-
12
- validates_presence_of :state_code, :if => Proc.new { |address| address.country_code.blank? || Carmen::Country.coded(address.country_code).try(:subregions).present? }
10
+ validates :category, :address1, :city, :country_code, :postal_code, presence: true, if: Proc.new { |address| address.present? }
11
+ validates :state_code, presence: true, if: Proc.new { |address| address.present? && (address.country_code.blank? || Carmen::Country.coded(address.country_code).try(:subregions).present?) }
13
12
 
14
13
  validates_format_of :postal_code, :with => POSTAL_CODE_CA,
15
14
  :if => proc { |address| Array(EffectiveAddresses.validate_postal_code_format).include?('CA') && address.country_code == 'CA' },
@@ -1,7 +1,7 @@
1
1
  class EffectiveAddressFullNamePresenceValidator < ActiveModel::EachValidator
2
2
  def validate_each(record, attribute, value)
3
3
  if value.present? && !value.empty? && value.full_name.blank?
4
- record.errors[attribute] << "is invalid"
4
+ record.errors[attribute] << 'is invalid'
5
5
  value.errors[:full_name] << "can't be blank"
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveAddresses
2
- VERSION = '1.5.0'.freeze
2
+ VERSION = '1.5.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.5.0
4
+ version: 1.5.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: 2016-03-30 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails