unidom-certificate 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -0
- data/app/models/unidom/certificate/certificating.rb +17 -0
- data/db/migrate/20010201000000_create_unidom_certificatings.rb +30 -0
- data/lib/unidom/certificate/version.rb +1 -1
- metadata +10 -24
- data/README.rdoc +0 -4
- data/db/migrate/20010201000000_create_unidom_china_identity_cards.rb +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b3f2dcda98b1225872f249e99e8c4b21a5b2669
|
4
|
+
data.tar.gz: 94395c61123f10afe28b3e11b32ce65ab8ad651d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7f52cdb4dd2a13945229135aa29a9af8b6f8d65aef365ff39d1623917fe18292a524dd5295b0824358c0223ca03886a3329d892a324a25aed09010d76220db9
|
7
|
+
data.tar.gz: 083f5b247e2df2017208ba0d103608277cb452e80fb5a38c15310c5c8d580f1f9a0219843f7217a4eacab5d0b835c152f82fad269f83a85bb01395a77a5a8026
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Unidom Certificate 证书领域模型引擎
|
2
|
+
|
3
|
+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/unidom-certificate.svg)](https://badge.fury.io/rb/unidom-certificate)
|
5
|
+
|
6
|
+
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Certificate domain model engine includes Identity Card and Business License models.
|
7
|
+
Unidom (统一领域对象模型)是一系列的领域模型引擎。证书领域模型引擎包括身份证和营业执照的模型。
|
8
|
+
|
9
|
+
## Usage in Gemfile
|
10
|
+
```ruby
|
11
|
+
gem 'unidom-certificate'
|
12
|
+
```
|
13
|
+
|
14
|
+
## Run the Database Migration
|
15
|
+
```shell
|
16
|
+
rake db:migrate
|
17
|
+
```
|
18
|
+
|
19
|
+
## Call the Model
|
20
|
+
```ruby
|
21
|
+
Unidom::Certificate::Certificating.valid_at.alive.first
|
22
|
+
```
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Certificating 是参与者和证书之间的认证关系。
|
2
|
+
|
3
|
+
class Unidom::Certificate::Certificating
|
4
|
+
|
5
|
+
self.table_name = 'unidom_certificatings'
|
6
|
+
|
7
|
+
belongs_to :certificator, polymorphic: true
|
8
|
+
belongs_to :certificated, polymorphic: true
|
9
|
+
belongs_to :certification, polymorphic: true
|
10
|
+
|
11
|
+
scope :certificated_by, ->(certificator) { where certificator: certificator }
|
12
|
+
scope :certificated_is, ->(certificated) { where certificated: certificated }
|
13
|
+
scope :certification_is, ->(certification) { where certification: certification }
|
14
|
+
|
15
|
+
include Unidom::Common::Concerns::ModelExtension
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class CreateUnidomCertificatings < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def change
|
4
|
+
|
5
|
+
create_table :unidom_certificatings, id: :uuid do |t|
|
6
|
+
|
7
|
+
t.references :certificator, type: :uuid, null: false,
|
8
|
+
polymorphic: { null: false, default: '', limit: 200 }
|
9
|
+
t.references :certificated, type: :uuid, null: false,
|
10
|
+
polymorphic: { null: false, default: '', limit: 200 }
|
11
|
+
t.references :certification, type: :uuid, null: false,
|
12
|
+
polymorphic: { null: false, default: '', limit: 200 }
|
13
|
+
|
14
|
+
t.column :state, 'char(1)', null: false, default: 'C'
|
15
|
+
t.datetime :opened_at, null: false, default: ::Time.utc(1970)
|
16
|
+
t.datetime :closed_at, null: false, default: ::Time.utc(3000)
|
17
|
+
t.boolean :defunct, null: false, default: false
|
18
|
+
t.jsonb :notation, null: false, default: {}
|
19
|
+
|
20
|
+
t.timestamps null: false
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
add_index :unidom_certificatings, :certificator_id
|
25
|
+
add_index :unidom_certificatings, :certificated_id
|
26
|
+
add_index :unidom_certificatings, :certification_id
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-certificate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: unidom-common
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: pg
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
26
|
+
version: '0.2'
|
41
27
|
description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
|
42
28
|
The Certificate domain model engine includes Identity Card and Business License
|
43
29
|
models. Unidom (统一领域对象模型)是一系列的领域模型引擎。证书领域模型引擎包括身份证和营业执照的模型。
|
@@ -48,15 +34,16 @@ extensions: []
|
|
48
34
|
extra_rdoc_files: []
|
49
35
|
files:
|
50
36
|
- MIT-LICENSE
|
51
|
-
- README.
|
37
|
+
- README.md
|
52
38
|
- Rakefile
|
53
39
|
- app/assets/javascripts/unidom/certificate/application.js
|
54
40
|
- app/assets/stylesheets/unidom/certificate/application.css
|
55
41
|
- app/controllers/unidom/certificate/application_controller.rb
|
56
42
|
- app/helpers/unidom/certificate/application_helper.rb
|
43
|
+
- app/models/unidom/certificate/certificating.rb
|
57
44
|
- app/views/layouts/unidom/certificate/application.html.erb
|
58
45
|
- config/routes.rb
|
59
|
-
- db/migrate/
|
46
|
+
- db/migrate/20010201000000_create_unidom_certificatings.rb
|
60
47
|
- lib/tasks/certificate_tasks.rake
|
61
48
|
- lib/unidom/certificate.rb
|
62
49
|
- lib/unidom/certificate/engine.rb
|
@@ -81,9 +68,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
68
|
version: '0'
|
82
69
|
requirements: []
|
83
70
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.4.
|
71
|
+
rubygems_version: 2.4.5.1
|
85
72
|
signing_key:
|
86
73
|
specification_version: 4
|
87
|
-
summary:
|
88
|
-
models.
|
74
|
+
summary: Unidom Certificate Domain Model Engine 证书领域模型引擎
|
89
75
|
test_files: []
|
data/README.rdoc
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
class CreateUnidomChinaIdentityCards < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def change
|
4
|
-
|
5
|
-
create_table :unidom_china_identity_cards, id: :uuid do |t|
|
6
|
-
|
7
|
-
t.string :name, null: false, default: '', limit: 16
|
8
|
-
t.date :birth_date, null: false, default: nil
|
9
|
-
t.string :address, null: false, default: '', limit: 200
|
10
|
-
|
11
|
-
t.column :gender_code, 'char(1)', null: false, default: '0'
|
12
|
-
t.column :ethnicity_code, 'char(2)', null: false, default: 'HA'
|
13
|
-
t.column :identification_number, 'char(18)', null: false, default: nil
|
14
|
-
|
15
|
-
# t.column :encrypted_identification_number, 'char(45)', null: false, default: nil
|
16
|
-
# t.column :encryption_pepper, 'char(21)', null: false, default: nil
|
17
|
-
|
18
|
-
t.string :issuing_authority_name, null: false, default: '', limit: 200
|
19
|
-
t.date :validity_from_date, null: false, default: '2005-01-01'
|
20
|
-
t.date :validity_thru_date, null: false, default: '2025-01-01'
|
21
|
-
|
22
|
-
# t.string :slug, null: false, default: nil, limit: 200
|
23
|
-
|
24
|
-
t.column :state, 'char(1)', null: false, default: 'C'
|
25
|
-
t.datetime :opened_at, null: false, default: ::Time.utc(1970)
|
26
|
-
t.datetime :closed_at, null: false, default: ::Time.utc(3000)
|
27
|
-
t.boolean :defunct, null: false, default: false
|
28
|
-
t.jsonb :notation, null: false, default: {}
|
29
|
-
|
30
|
-
t.timestamps null: false
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
add_index :unidom_china_identity_cards, :identification_number
|
35
|
-
# add_index :unidom_china_identity_cards, :encrypted_identification_number
|
36
|
-
# add_index :unidom_china_identity_cards, :slug, unique: true
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|