unidom-party 1.4 → 1.5

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: 3265651cea821f567d8e9ecd4f0375eae55206b3
4
- data.tar.gz: 5b21ba81d356d0249622de5854e23b4dd4ecc7b9
3
+ metadata.gz: 1057f563c0a9897abb1cfb50a9d81fe68a3eeb1d
4
+ data.tar.gz: d485cba734c97ab3aaa54edec1e3e9063ed4648a
5
5
  SHA512:
6
- metadata.gz: 9e4e72807cd3cc3778527d40496c9573b69019eea9d76f7e5a6d373f4cf173539493fdfa62dbd3485172b645ef384535d5476ec13d485f589d63efdb2e327fdb
7
- data.tar.gz: 343170ed2c9fbb2332e1fc8280998a8bd5dfbd06c4df95ef4f8b196a80ea2d9e7314315a82f1a95a4bf3a6239138dfab9f00d10f34fef4e3555197fb045c6aad
6
+ metadata.gz: 5d80fbbff8f48215185d941d7a2fa876d4c4ac7aee30799b2e85da4e9b1326b71b5028a82cacb6eac9ff90de525e1454d06f583a184d61e10cc7c934444eb14b
7
+ data.tar.gz: d1bbab9d8d7c7f16178c0a0c118efc2e1dda0e3e409a378f55312e0afbbde6f5eef7f871e1510fb0517388c97b1a1ac2349c83f4d813b8451002a167ba859e18
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-party.svg)](https://badge.fury.io/rb/unidom-party)
5
+ [![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-party.svg)](https://gemnasium.com/github.com/topbitdu/unidom-party)
5
6
 
6
7
  Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Party domain model engine includes Person, Shop, and Company 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-party'
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 200101.
23
33
 
34
+
35
+
24
36
  ## Call the Model
37
+
25
38
  ```ruby
26
39
  company = Unidom::Party::Company.valid_at.alive.first
27
40
  company.target_party_relations
@@ -49,19 +62,34 @@ Unidom::Party::Collaborating.collaborate! collaboration: project, collaborator:
49
62
 
50
63
 
51
64
  ## Inlcude the Concerns
65
+
52
66
  ```ruby
53
67
  include Unidom::Party::Concerns::AsSourceParty
54
68
  include Unidom::Party::Concerns::AsTargetParty
69
+ include Unidom::Party::Concerns::AsCollaboration
70
+ include Unidom::Party::Concerns::AsCollaborator
55
71
  ```
56
72
 
57
73
  ### As Source Party concern
74
+
58
75
  The As Source Party concern do the following tasks for the includer automatically:
59
- 1. Define the has_many :target_party_relations macro as: ``has_many :target_party_relations, class_name: 'Unidom::Party::PartyRelation', as: :source_party``
60
- 2. Define the #relate! method as: ``relate!(to: nil, due_to: nil, at: Time.now)``
76
+ 1. Define the has_many :target_party_relations macro as: ``has_many :target_party_relations, class_name: 'Unidom::Party::PartyRelation', as: :source_party``
77
+ 2. Define the #relate! method as: ``relate!(to: nil, due_to: nil, at: Time.now)``
61
78
  3. Define the #relate? method as: ``relate?(to: nil, due_to: nil, at: Time.now)``
62
79
 
63
80
  ### As Target Party concern
81
+
64
82
  The As Target Party concern do the following tasks for the includer automatically:
65
- 1. Define the has_many :source_party_relations macro as: ``has_many :source_party_relations, class_name: 'Unidom::Party::PartyRelation', as: :target_party``
66
- 2. Define the #is_related! method as: ``is_related!(to: nil, due_to: nil, at: Time.now)``
83
+ 1. Define the has_many :source_party_relations macro as: ``has_many :source_party_relations, class_name: 'Unidom::Party::PartyRelation', as: :target_party``
84
+ 2. Define the #is_related! method as: ``is_related!(to: nil, due_to: nil, at: Time.now)``
67
85
  3. Define the #is_related? method as: ``is_related?(to: nil, due_to: nil, at: Time.now)``
86
+
87
+ ### As Collaboration concern
88
+
89
+ The As Collaboration concern do the following tasks for the includer automatically:
90
+ 1. Define the has_many :collaboratings macro as: ``has_many :collaboratings, class_name: 'Unidom::Party::Collaborating', as: :collaboration``
91
+
92
+ ### As Collaborator concern
93
+
94
+ The As Collaborator concern do the following tasks for the includer automatically:
95
+ 1. Define the has_many :collaboratings macro as: ``has_many :collaboratings, class_name: 'Unidom::Party::Collaborating', as: :collaborator``
@@ -0,0 +1,14 @@
1
+ module Unidom::Party::Concerns::AsCollaboration
2
+
3
+ extend ActiveSupport::Concern
4
+
5
+ included do |includer|
6
+
7
+ has_many :collaboratings, class_name: 'Unidom::Party::Collaborating', as: :collaboration
8
+
9
+ end
10
+
11
+ module ClassMethods
12
+ end
13
+
14
+ end
@@ -0,0 +1,14 @@
1
+ module Unidom::Party::Concerns::AsCollaborator
2
+
3
+ extend ActiveSupport::Concern
4
+
5
+ included do |includer|
6
+
7
+ has_many :collaboratings, class_name: 'Unidom::Party::Collaborating', as: :collaborator
8
+
9
+ end
10
+
11
+ module ClassMethods
12
+ end
13
+
14
+ end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Party
3
- VERSION = '1.4'.freeze
3
+ VERSION = '1.5'.freeze
4
4
  end
5
5
  end
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: '1.4'
4
+ version: '1.5'
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-10-04 00:00:00.000000000 Z
11
+ date: 2016-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -42,6 +42,8 @@ files:
42
42
  - app/helpers/unidom/party/application_helper.rb
43
43
  - app/models/unidom/party/collaborating.rb
44
44
  - app/models/unidom/party/company.rb
45
+ - app/models/unidom/party/concerns/as_collaboration.rb
46
+ - app/models/unidom/party/concerns/as_collaborator.rb
45
47
  - app/models/unidom/party/concerns/as_source_party.rb
46
48
  - app/models/unidom/party/concerns/as_target_party.rb
47
49
  - app/models/unidom/party/government_agency.rb