checkout/lib/market_town/checkout/models/address.rb
# Validates an address, throws {InvalidError} if invalid
#
# @param [Hash] address_attrs
# @option address_attrs [String] :name
# @option address_attrs [String] :company
# @option address_attrs [String] :address_1
# @option address_attrs [String] :address_2
# @option address_attrs [String] :locality
# @option address_attrs [String] :region
# @option address_attrs [String] :postal_code
# @option address_attrs [String] :country must be valid ISO3166 alpha 2
# @option address_attrs [String] :phone_number
#
# @raise [InvalidError] if address invalid
#
Validates an address, throws {InvalidError} if invalid
Validates an address throws { InvalidError } if invalid
def country_is_iso3166
        if ISO3166::Country.find_country_by_alpha2(country).nil?
          errors.add(:country, 'Country was not valid ISO3166 alpha 2')
        end
      end
def country_is_iso3166 if ISO3166 :: Country . find_country_by_alpha2 ( country ) . nil? errors . add ( :country , 'Country was not valid ISO3166 alpha 2' ) end end
Validates an address, throws {InvalidError} if invalid
Validates an address throws { InvalidError } if invalid
[InvalidError] if address invalid
[ InvalidError ] if address invalid
<not_specific>
None
address_attrs
<not_specific>
None