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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 040257bf768402e6145101e420df24f063c5a8c3
|
4
|
+
data.tar.gz: 0ee1ac756cf2119af9408f88517b5e630e361316
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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] <<
|
4
|
+
record.errors[attribute] << 'is invalid'
|
5
5
|
value.errors[:full_name] << "can't be blank"
|
6
6
|
end
|
7
7
|
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.
|
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-
|
11
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|