unidom-party 0.2 → 0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a760d7525432b70532d83bd478caa844e4a97c74
|
4
|
+
data.tar.gz: cb9a30cccd681d1f7eac1641e36fc56dc2ebb028
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b675822b65b66b1d33f7b37a411df9189def0927bfff79c5b47e7c022e718e8e986ad773bc69d89e1000ebd89e4c4f10565d5ffaf18d2487993e836cb69fd5cd
|
7
|
+
data.tar.gz: eecb39089a974bfc5aff0a1351677b1cf08871ff326264fd7c4566b9abae98e3e37240386941fd47a5ceadceedf515b0b00a7dae76304792e43d5e78157f9f1c
|
data/README.md
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Government Agency 是政府机构。
|
2
|
+
class Unidom::Party::GovernmentAgency < ActiveRecord::Base
|
3
|
+
|
4
|
+
self.table = 'unidom_government_agencies'
|
5
|
+
|
6
|
+
validates :name, presence: true, length: { in: 2..self.columns_hash['name'].limit }
|
7
|
+
|
8
|
+
belongs_to :supervision_region, polymorphic: true
|
9
|
+
|
10
|
+
has_many :source_party_relations, class_name: 'Unidom::Party::PartyRelation', as: :target_party
|
11
|
+
has_many :target_party_relations, class_name: 'Unidom::Party::PartyRelation', as: :source_party
|
12
|
+
|
13
|
+
scope :supervision_region_is, ->(region) { where supervision_region: region }
|
14
|
+
|
15
|
+
include Unidom::Common::Concerns::ModelExtension
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class CreateUnidomGovernmentAgencies < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def change
|
4
|
+
|
5
|
+
create_table :unidom_government_agencies, id: :uuid do |t|
|
6
|
+
|
7
|
+
t.references :supervision_region, type: :uuid, null: false,
|
8
|
+
polymorphic: { null: false, default: '', limit: 200 }
|
9
|
+
|
10
|
+
t.string :name, null: false, default: '', limit: 200
|
11
|
+
|
12
|
+
t.column :function_code, 'char(4)', null: false, default: 'ZZZZ'
|
13
|
+
|
14
|
+
t.text :description
|
15
|
+
|
16
|
+
t.string :slug, null: false, default: nil, limit: 200
|
17
|
+
t.column :state, 'char(1)', null: false, default: 'C'
|
18
|
+
t.datetime :opened_at, null: false, default: ::Time.utc(1970)
|
19
|
+
t.datetime :closed_at, null: false, default: ::Time.utc(3000)
|
20
|
+
t.boolean :defunct, null: false, default: false
|
21
|
+
t.jsonb :notation, null: false, default: {}
|
22
|
+
|
23
|
+
t.timestamps null: false
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
add_index :unidom_government_agencies, :supervision_region_id
|
28
|
+
add_index :unidom_government_agencies, :slug, unique: true
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
data/lib/unidom/party/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- app/assets/stylesheets/unidom/party/application.css
|
41
41
|
- app/controllers/unidom/party/application_controller.rb
|
42
42
|
- app/helpers/unidom/party/application_helper.rb
|
43
|
+
- app/models/unidom/party/government_agency.rb
|
43
44
|
- app/models/unidom/party/party_relation.rb
|
44
45
|
- app/models/unidom/party/person.rb
|
45
46
|
- app/models/unidom/party/shop.rb
|
@@ -48,6 +49,7 @@ files:
|
|
48
49
|
- db/migrate/20010101000000_create_unidom_party_relations.rb
|
49
50
|
- db/migrate/20010102000000_create_unidom_people.rb
|
50
51
|
- db/migrate/20010103000000_create_unidom_shops.rb
|
52
|
+
- db/migrate/20010104000000_create_unidom_government_agencies.rb
|
51
53
|
- lib/tasks/party_tasks.rake
|
52
54
|
- lib/unidom/party.rb
|
53
55
|
- lib/unidom/party/engine.rb
|