unidom-contact-china 0.4.1 → 1.0
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: 2bbc3f605882dd5fe87d3682ccb8e7a05ab9f2f0
|
4
|
+
data.tar.gz: cfda62842bd5d640e37eba46e4a97f82732b8828
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5204905251053172737659e9b3b0d1f2b7bc85e06da079b62dfd3d351f33621a246f1d8799b0dc54110a0bb05ed773e6baf2ffc17fda72875a633ec7b4b21d94
|
7
|
+
data.tar.gz: a0388333d458e1c4c95fccec317bffc37e23314c2f649c7b0b8f1af7856b3c73a4d5b5367822380ce82af2243065d1986910b84b061eb8eb7573971d5e27a400
|
data/README.md
CHANGED
@@ -28,3 +28,13 @@ phone_number.save!
|
|
28
28
|
|
29
29
|
Unidom::Contact::China::MobilePhoneNumber.valid_at.alive.first # Get all active China mobile phone numbers
|
30
30
|
```
|
31
|
+
|
32
|
+
## Include the Concerns
|
33
|
+
```ruby
|
34
|
+
include Unidom::Contact::Concerns::AsContact
|
35
|
+
include Unidom::Contact::Concerns::AsSubscriber
|
36
|
+
```
|
37
|
+
|
38
|
+
### As Mobile Phone Number Subscriber concern
|
39
|
+
The As Mobile Phone Number Subscriber concern do the following tasks for the includer automatically:
|
40
|
+
1. Define the has_many :china_mobile_phone_numbers macro as: ``has_many :china_mobile_phone_numbers, through: :contact_subscriptions, source: :contact, source_type: 'Unidom::Contact::China::MobilePhoneNumber'``
|
@@ -6,7 +6,7 @@ module Unidom::Contact::China::Concerns::AsMobilePhoneNumberSubscriber
|
|
6
6
|
|
7
7
|
included do |includer|
|
8
8
|
|
9
|
-
|
9
|
+
has_many :china_mobile_phone_numbers, through: :contact_subscriptions, source: :contact, source_type: 'Unidom::Contact::China::MobilePhoneNumber'
|
10
10
|
|
11
11
|
end
|
12
12
|
|
@@ -7,15 +7,13 @@ class Unidom::Contact::China::MobilePhoneNumber < ActiveRecord::Base
|
|
7
7
|
self.table_name = 'unidom_china_mobile_phone_numbers'
|
8
8
|
|
9
9
|
include Unidom::Common::Concerns::ModelExtension
|
10
|
-
|
10
|
+
include Unidom::Contact::Concerns::AsContact
|
11
11
|
|
12
12
|
validates :phone_number, presence: true, length: { is: self.columns_hash['phone_number'].limit }, numericality: { integer_only: true }, format: FORMAT_VALIDATION_REGEX
|
13
13
|
validates :network_identification_number, presence: true, length: { is: self.columns_hash['network_identification_number'].limit }, numericality: { integer_only: true }
|
14
14
|
validates :serial_number, presence: true, length: { is: self.columns_hash['serial_number'].limit }, numericality: { integer_only: true }
|
15
15
|
validates :area_code, numericality: { integer_only: true }
|
16
16
|
|
17
|
-
has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :contact
|
18
|
-
|
19
17
|
scope :phone_number_is, ->(phone_number) { where phone_number: phone_number }
|
20
18
|
scope :network_identification_number_is, ->(network_identification_number) { where network_identification_number: network_identification_number }
|
21
19
|
scope :area_code_is, ->(area_code) { where area_code: area_code }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-contact-china
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0
|
4
|
+
version: '1.0'
|
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-08-
|
11
|
+
date: 2016-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: unidom-contact
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
27
41
|
description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
|
28
42
|
The China Region domain model engine includes Region and its relative models. Unidom
|
29
43
|
(统一领域对象模型)是一系列的领域模型引擎。中国联系方式领域模型引擎包括中国大陆的移动电话号码及其相关的模型。
|