Sha256: dba4310c4e20a894f928fffb91ba777e97e75116687d1dc735fe76a2dfa40839

Contents?: true

Size: 294 Bytes

Versions: 7

Compression:

Stored size: 294 Bytes

Contents

Spree::StockLocation.class_eval do
  validates_presence_of :address1, :city, :zipcode, :country_id
  validate :state_id_or_state_name_is_present

  def state_id_or_state_name_is_present
    if state_id.nil? && state_name.nil?
        errors.add(:state_name, "can't be blank")
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
solidus_active_shipping-1.0.0 app/models/spree/stock_location_decorator.rb
spree_correios_shipping-1.1.4 app/models/spree/stock_location_decorator.rb
spree_correios_shipping-1.1.3 app/models/spree/stock_location_decorator.rb
spree_correios_shipping-1.1.2 app/models/spree/stock_location_decorator.rb
spree_correios_shipping-1.1.1 app/models/spree/stock_location_decorator.rb
spree_correios_shipping-1.1.0 app/models/spree/stock_location_decorator.rb
spree_correios_shipping-1.0.0 app/models/spree/stock_location_decorator.rb