1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/models/relation_status.rb

29 lines
600 B
Ruby

# frozen_string_literal: true
class RelationStatus < ApplicationRecord
################
# Associations #
################
has_many :transitions,
class_name: 'RelationTransition',
inverse_of: :from_status,
foreign_key: :from_status_id,
dependent: :restrict_with_exception
###############
# Validations #
###############
validates :codename, codename: true, uniqueness: { case_sensitive: false }
validates :name, good_small_text: true, uniqueness: true
###########
# Methods #
###########
def to_param
codename
end
end