Class: GeographicAreaType
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- GeographicAreaType
- Defined in:
- app/models/geographic_area_type.rb
Overview
A GeographicAreaType is a string describing the (generally local) name for the (generally) political designation of the area.
Constant Summary collapse
- COUNTRY_LEVEL_TYPES =
%w(Country Governorate).freeze
- STATE_LEVEL_TYPES =
%w(State Province District Prefecture Region Territory Republic Area Oblast Krai).freeze
- COUNTY_LEVEL_TYPES =
%w(County Parish Borough Canton Department Raion).freeze
Instance Attribute Summary collapse
-
#name ⇒ String
The name of the geographic area type.
Attributes included from Housekeeping::Users
Method Summary
Methods included from Shared::IsData
#errors_excepting, #full_error_messages_excepting, #identical, #is_community?, #is_destroyable?, #is_editable?, #is_in_use?, #is_in_users_projects?, #metamorphosize, #similar
Methods included from Housekeeping::Users
#set_created_by_id, #set_updated_by_id
Methods inherited from ApplicationRecord
Instance Attribute Details
#name ⇒ String
The name of the geographic area type.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/models/geographic_area_type.rb', line 8 class GeographicAreaType < ApplicationRecord include Housekeeping::Users include Housekeeping::Timestamps include Shared::IsData include Shared::IsApplicationData COUNTRY_LEVEL_TYPES = %w(Country Governorate).freeze STATE_LEVEL_TYPES = %w(State Province District Prefecture Region Territory Republic Area Oblast Krai).freeze COUNTY_LEVEL_TYPES = %w(County Parish Borough Canton Department Raion).freeze has_many :geographic_areas, inverse_of: :geographic_area_type validates :name, uniqueness: true, presence: true end |