Module: ActiveModel::Validations::ClassMethods

Defined in:
lib/shopify_countries/validators/validates_shopify_country_of.rb

Instance Method Summary collapse

Instance Method Details

#validates_shopify_country_of(*attr_names) ⇒ Object

Validates whether or not the specified country is Shopify’s.

class Address < ActiveRecord::Base
  validates_shopify_country_of :country
end


30
31
32
# File 'lib/shopify_countries/validators/validates_shopify_country_of.rb', line 30

def validates_shopify_country_of(*attr_names)
  validates_with ShopifyCountryValidator, _merge_attributes(attr_names)
end