Sha256: 07e9ae96097668e74724e93112758227564afa06d46d2279b6cd77d3fb9558a1

Contents?: true

Size: 731 Bytes

Versions: 1

Compression:

Stored size: 731 Bytes

Contents

# Government Agency 是政府机构。
# function_code 是行政职能代码: PLST: Police Station 公安局, PLSS: Police Sub-Station 派出所
class Unidom::Party::GovernmentAgency < ActiveRecord::Base

  self.table_name = 'unidom_government_agencies'

  validates :name, presence: true, length: { in: 2..self.columns_hash['name'].limit }

  belongs_to :supervision_region, polymorphic: true

  has_many :source_party_relations, class_name: 'Unidom::Party::PartyRelation', as: :target_party
  has_many :target_party_relations, class_name: 'Unidom::Party::PartyRelation', as: :source_party

  scope :supervision_region_is, ->(region) { where supervision_region: region }

  include Unidom::Common::Concerns::ModelExtension

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-party-0.6 app/models/unidom/party/government_agency.rb