Sha256: bd01c819c5b4a6b2b660fb256c5dd0d2d5fb0314769b933755cafc084ddb930c

Contents?: true

Size: 298 Bytes

Versions: 2

Compression:

Stored size: 298 Bytes

Contents

# frozen_string_literal: true

class Province < ApplicationRecord
  # Validations
  validates :code, presence: true
  validates :name, presence: true, uniqueness: {
    case_sensitive: false
  }

  # Relationships
  has_many :cities, dependent: :destroy
  has_many :districts, through: :cities
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
china_regions-1.0.4 app/models/province.rb
china_regions-1.0.3 app/models/province.rb