Module: Tienda::AssociatedCountries
- Included in:
- DeliveryServicePrice, TaxRate
- Defined in:
- lib/tienda/associated_countries.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 6 |
# File 'lib/tienda/associated_countries.rb', line 3 def self.included(base) base.serialize :country_ids, Array base.before_validation { self.country_ids = country_ids.map(&:to_i).select { |i| i > 0 } if country_ids.is_a?(Array) } end |