demarches-normaliennes/app/models/zone.rb

15 lines
416 B
Ruby
Raw Normal View History

2021-12-01 20:00:29 +01:00
# == Schema Information
#
# Table name: zones
#
# id :bigint not null, primary key
# acronym :string not null
2021-12-01 20:00:29 +01:00
# label :string
# created_at :datetime not null
# updated_at :datetime not null
#
class Zone < ApplicationRecord
validates :acronym, presence: true, uniqueness: true
has_many :procedures, -> { order(published_at: :desc) }, inverse_of: :zone
2021-12-01 20:00:29 +01:00
end