unidom-certificate 2.0 → 2.0.1
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 -4
- data/Rakefile +2 -2
- data/app/assets/config/unidom-certificate_manifest.js +2 -0
- data/app/assets/javascripts/unidom/certificate/application.js +1 -1
- data/app/assets/stylesheets/unidom/certificate/application.css +3 -3
- data/app/controllers/unidom/certificate/application_controller.rb +1 -0
- data/app/jobs/unidom/certificate/application_job.rb +2 -0
- data/app/mailers/unidom/certificate/application_mailer.rb +4 -0
- data/app/models/unidom/certificate/application_record.rb +3 -0
- data/app/models/unidom/certificate/certificating.rb +1 -9
- data/app/models/unidom/certificate/concerns/as_certificated.rb +3 -0
- data/app/models/unidom/certificate/concerns/as_certification.rb +3 -0
- data/lib/unidom/certificate/version.rb +1 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a8ab7dcf93fd2c4e10d19d97eade7334fa3cd71
|
4
|
+
data.tar.gz: e1876b4f555b1777a82c6363f4cd06d9b9952c0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 375fd055b92df6b8401918472a4a0f96de7d4ca9b289fb29a5bd91731c4d1283f0d4f2e5ca1d92cb1e55d7edb15147d6c6d31a6085640b9b4d86a473ea5b5666
|
7
|
+
data.tar.gz: ab9cc667a9220ed3ccd36dc6e30aacaccbe013f6b304441bcd59cde93c025c1cac4dc4c2d5e8f6229b513c49b76f79ed327a2ab5958b225493f29f3f5a9b7d28
|
data/README.md
CHANGED
@@ -2,26 +2,39 @@
|
|
2
2
|
|
3
3
|
[![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/unidom-certificate.svg)](https://badge.fury.io/rb/unidom-certificate)
|
5
|
+
[![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-certificate.svg)](https://gemnasium.com/github.com/topbitdu/unidom-certificate)
|
5
6
|
|
6
7
|
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
8
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。证书领域模型引擎包括身份证和营业执照的模型。
|
8
9
|
|
10
|
+
|
11
|
+
|
9
12
|
## Recent Update
|
13
|
+
|
10
14
|
Check out the [Road Map](ROADMAP.md) to find out what's the next.
|
11
15
|
Check out the [Change Log](CHANGELOG.md) to find out what's new.
|
12
16
|
|
17
|
+
|
18
|
+
|
13
19
|
## Usage in Gemfile
|
20
|
+
|
14
21
|
```ruby
|
15
22
|
gem 'unidom-certificate'
|
16
23
|
```
|
17
24
|
|
25
|
+
|
26
|
+
|
18
27
|
## Run the Database Migration
|
28
|
+
|
19
29
|
```shell
|
20
30
|
rake db:migrate
|
21
31
|
```
|
22
32
|
The migration versions start with 200102.
|
23
33
|
|
34
|
+
|
35
|
+
|
24
36
|
## Call the Model
|
37
|
+
|
25
38
|
```ruby
|
26
39
|
officer = Unidom::Party::Person.create! name: 'John'
|
27
40
|
mall = Unidom::Party::Shop.create! name: 'WalMart'
|
@@ -29,20 +42,25 @@ certification = Unidom::Certificate::China::BusinessLicense.registration_number_
|
|
29
42
|
certificating = Unidom::Certificate::Certificating.certificate!(certification: certification, certificated: mall, certificator: officer, opened_at: Time.now)
|
30
43
|
```
|
31
44
|
|
45
|
+
|
46
|
+
|
32
47
|
## Include the Concerns
|
48
|
+
|
33
49
|
```ruby
|
34
50
|
include Unidom::Certificate::Concerns::AsCertificated
|
35
51
|
include Unidom::Certificate::Concerns::AsCertification
|
36
52
|
```
|
37
53
|
|
38
54
|
### As Certificated concern
|
55
|
+
|
39
56
|
The As Certificated concern do the following tasks for the includer automatically:
|
40
|
-
1. Define the has_many :certificatings macro as: ``has_many :certificatings, class_name: 'Unidom::Certificate::Certificating', as: :certificated``
|
41
|
-
2. Define the #is_certificated! method as: ``def is_certificated!(certification, by: nil, at: Time.now)``
|
57
|
+
1. Define the has_many :certificatings macro as: ``has_many :certificatings, class_name: 'Unidom::Certificate::Certificating', as: :certificated``
|
58
|
+
2. Define the #is_certificated! method as: ``def is_certificated!(certification, by: nil, at: Time.now)``
|
42
59
|
3. Define the #is_certificated? method as: ``def is_certificated?(certification, at: Time.now)``
|
43
60
|
|
44
61
|
### As Certification concern
|
62
|
+
|
45
63
|
The As Certification concern do the following tasks for the includer automatically:
|
46
|
-
1. Define the has_many :certificatings macro as: ``has_many :certificatings, class_name: 'Unidom::Certificate::Certificating', as: :certification``
|
47
|
-
2. Define the #certificate! method as: ``def certificate!(certificated, by: nil, at: Time.now)``
|
64
|
+
1. Define the has_many :certificatings macro as: ``has_many :certificatings, class_name: 'Unidom::Certificate::Certificating', as: :certification``
|
65
|
+
2. Define the #certificate! method as: ``def certificate!(certificated, by: nil, at: Time.now)``
|
48
66
|
3. Define the #certificate? method as: ``def certificate?(certificated, at: Time.now)``
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
10
|
rdoc.rdoc_dir = 'rdoc'
|
11
11
|
rdoc.title = 'Unidom Certificate'
|
12
12
|
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
@@ -20,5 +20,5 @@ load 'rails/tasks/statistics.rake'
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
23
|
+
require 'bundler/gem_tasks'
|
24
24
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
6
|
//
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
9
|
//
|
10
10
|
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
11
|
// about supported directives.
|
@@ -6,9 +6,9 @@
|
|
6
6
|
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
7
|
*
|
8
8
|
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any
|
10
|
-
*
|
11
|
-
* file per style scope.
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
12
|
*
|
13
13
|
*= require_self
|
14
14
|
*/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Certificating 是参与者和证书之间的认证关系。
|
2
2
|
|
3
|
-
class Unidom::Certificate::Certificating <
|
3
|
+
class Unidom::Certificate::Certificating < Unidom::Certificate::ApplicationRecord
|
4
4
|
|
5
5
|
self.table_name = 'unidom_certificatings'
|
6
6
|
|
@@ -14,10 +14,6 @@ class Unidom::Certificate::Certificating < ActiveRecord::Base
|
|
14
14
|
scope :certificated_is, ->(certificated) { where certificated: certificated }
|
15
15
|
scope :certification_is, ->(certification) { where certification: certification }
|
16
16
|
|
17
|
-
#def self.certificate(certification: nil, certificated: nil, certificator: nil, opened_at: Time.now)
|
18
|
-
# certificate! certification: certification, certificated: certificated, certificator: certificator, opened_at: opened_at
|
19
|
-
#end
|
20
|
-
|
21
17
|
def self.certificate!(certification: nil, certificated: nil, certificator: nil, opened_at: Time.now)
|
22
18
|
raise ArgumentError.new('The certification argument is required.') if certification.blank?
|
23
19
|
raise ArgumentError.new('The certificated argument is required.' ) if certificated.blank?
|
@@ -33,8 +29,4 @@ class Unidom::Certificate::Certificating < ActiveRecord::Base
|
|
33
29
|
self.certification_is(certification).certificated_is(certificated).valid_at(now: opened_at).alive.first_or_create! attributes
|
34
30
|
end
|
35
31
|
|
36
|
-
#class << self
|
37
|
-
# deprecate certificate: :certificate!, deprecator: ActiveSupport::Deprecation.new('2.0', 'unidom-certificate')
|
38
|
-
#end
|
39
|
-
|
40
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-certificate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
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-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.6'
|
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: '1.
|
26
|
+
version: '1.6'
|
27
27
|
description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
|
28
28
|
The Certificate domain model engine includes Identity Card and Business License
|
29
29
|
models. Unidom (统一领域对象模型)是一系列的领域模型引擎。证书领域模型引擎包括身份证和营业执照的模型。
|
@@ -36,10 +36,14 @@ files:
|
|
36
36
|
- MIT-LICENSE
|
37
37
|
- README.md
|
38
38
|
- Rakefile
|
39
|
+
- app/assets/config/unidom-certificate_manifest.js
|
39
40
|
- app/assets/javascripts/unidom/certificate/application.js
|
40
41
|
- app/assets/stylesheets/unidom/certificate/application.css
|
41
42
|
- app/controllers/unidom/certificate/application_controller.rb
|
42
43
|
- app/helpers/unidom/certificate/application_helper.rb
|
44
|
+
- app/jobs/unidom/certificate/application_job.rb
|
45
|
+
- app/mailers/unidom/certificate/application_mailer.rb
|
46
|
+
- app/models/unidom/certificate/application_record.rb
|
43
47
|
- app/models/unidom/certificate/certificating.rb
|
44
48
|
- app/models/unidom/certificate/concerns/as_certificated.rb
|
45
49
|
- app/models/unidom/certificate/concerns/as_certification.rb
|