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/federal_subject.rb
2019-06-23 20:54:41 +05:00

27 lines
506 B
Ruby

# frozen_string_literal: true
class FederalSubject < ApplicationRecord
################
# Associations #
################
has_one :regional_office, dependent: :restrict_with_exception
###############
# Validations #
###############
validates :english_name, presence: true, uniqueness: true
validates :native_name, presence: true, uniqueness: true
###########
# Methods #
###########
def display_name
return native_name if I18n.locale == :ru
english_name
end
end