Sha256: 0e3eae4d5dc6858720952abbb96074a06d87de25773d1a84b496ce1df3123d44

Contents?: true

Size: 359 Bytes

Versions: 2

Compression:

Stored size: 359 Bytes

Contents

#
# Region/Province/Estado
#
class Region
  include Mongoid::Document
  include Geopolitocracy

  field :zips,   type: Array  # zip codes
  field :codes,  type: Array  # phone codes

  belongs_to :nation

  has_many :cities,  dependent: :destroy

  validates :nation, presence: true
  validates :name,   presence: true,  uniqueness: { scope: :nation_id }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
geopolitical-0.8.7 app/models/region.rb
geopolitical-0.8.6 app/models/region.rb