unidom-certificate-china 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9f951709eabad4e2442dc82ab2bb324c82cd81a
|
4
|
+
data.tar.gz: 1bc1a62bb5e6a1a3c03170366723dbb29b416749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d390d1831f2310a171c7ac0d7fb597a97523db97eba2f8c77b1287afab97c480160a1246f7a468253727db83be0af253019e316cdfa6fba7720e20f5abf12578
|
7
|
+
data.tar.gz: c968987d31b11fe838e0cd083848a2f76ddb7af43d593a1a44f25041099cbc7a9a4c3f11b84f17e66e1167417fa823d0489f97dc98e85197915c2af41cb20d1f
|
data/README.md
CHANGED
@@ -1,21 +1,22 @@
|
|
1
|
-
# Unidom Certificate China
|
1
|
+
# Unidom Certificate China 中国证件领域模型引擎
|
2
2
|
|
3
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-china.svg)](https://badge.fury.io/rb/unidom-certificate-china)
|
4
5
|
|
5
6
|
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The China Certificate domain model engine includes Identity Card, Driving License, and Business License models.
|
6
7
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。中国证件领域模型引擎包括中国大陆的身份证、驾驶证、营业执照等模型。
|
7
8
|
|
8
|
-
## Usage in Gemfile
|
9
|
+
## Usage in Gemfile
|
9
10
|
```ruby
|
10
11
|
gem 'unidom-certificate-china'
|
11
12
|
```
|
12
13
|
|
13
|
-
## Run the Database Migration
|
14
|
+
## Run the Database Migration
|
14
15
|
```shell
|
15
16
|
rake db:migrate
|
16
17
|
```
|
17
18
|
|
18
|
-
## Call the Model
|
19
|
+
## Call the Model
|
19
20
|
```ruby
|
20
21
|
Unidom::Certificate::China::IdentityCard.identification_number_is('51010519801231123X').first
|
21
22
|
```
|
@@ -13,6 +13,8 @@ class Unidom::Certificate::China::IdentityCard < ActiveRecord::Base
|
|
13
13
|
|
14
14
|
scope :identification_number_is, ->(identification_number) { where identification_number: identification_number }
|
15
15
|
|
16
|
+
include Unidom::Common::Concerns::ModelExtension
|
17
|
+
|
16
18
|
before_validation -> {
|
17
19
|
self.birth_date = Date.parse "#{identification_number[6..9]}-#{identification_number[10..11]}-#{identification_number[12..13]}"
|
18
20
|
self.gender_code = identification_number[16].to_i.odd? ? '1' : '2'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-certificate-china
|
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: 2016-02-
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-certificate
|
@@ -71,6 +71,5 @@ rubyforge_project:
|
|
71
71
|
rubygems_version: 2.4.5.1
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
|
-
summary:
|
75
|
-
License, and Business License models.
|
74
|
+
summary: Unidom China Certificate Domain Model Engine 中国证件领域模型引擎
|
76
75
|
test_files: []
|