Sha256: 507dcfcd0fa49eeb987f2da22ff7789da8d87e3855ffc06c105e5787d20b767a

Contents?: true

Size: 392 Bytes

Versions: 1

Compression:

Stored size: 392 Bytes

Contents

class InscriptioCursualis::District < InscriptioCursualis::Model
  self.abstract_class = true

  has_paper_trail

  belongs_to :city, class_name: '::City'

  has_many :neighborhoods, class_name: '::Neighborhood', dependent: :restrict_with_exception

  validates :name, :city, presence: true
  validates :name, uniqueness: { scope: :city_id }, allow_blank: true

  def to_s
    name
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unico-training-7.8.0 app/models/inscriptio_cursualis/district.rb