Sha256: c364bc9a627bf7072f341814051c5897db4b9d29d72bcb9cf168ff9243d8194f

Contents?: true

Size: 415 Bytes

Versions: 4

Compression:

Stored size: 415 Bytes

Contents

# Town 是乡或者镇。

class Unidom::Geo::China::Town < Unidom::Geo::China::ApplicationRecord

  self.table_name = 'unidom_china_towns'

  include Unidom::Common::Concerns::ModelExtension

  validates :name, presence: true, length: { in: 2..self.columns_hash['name'].limit }

  belongs_to :region, class_name: 'Unidom::Geo::China::Region'

  scope :region_is, ->(region) { where region_id: to_id(region) }

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
unidom-geo-china-0.4.4 app/models/unidom/geo/china/town.rb
unidom-geo-china-0.4.3 app/models/unidom/geo/china/town.rb
unidom-geo-china-0.4.2 app/models/unidom/geo/china/town.rb
unidom-geo-china-0.4.1 app/models/unidom/geo/china/town.rb