Sha256: 7bc5397ceffa9b5e3316f0898ba684cb667d1c8e94f418d6e535234c076070f7

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

# Government Agency 是政府机构。
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

2 entries across 2 versions & 1 rubygems

Version Path
unidom-party-0.5 app/models/unidom/party/government_agency.rb
unidom-party-0.4.1 app/models/unidom/party/government_agency.rb