unidom-accession 1.2 → 1.3

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: 79db48b2b27167c6a317d34048dd7b657ef3b322
4
- data.tar.gz: e7ea244dbbca98b5427d596e40c0cb3d1bc802a7
3
+ metadata.gz: b0c9247b0118409631053410c1fbc45a94c0abdb
4
+ data.tar.gz: 02c6c79665d9af4cd34be0dcbca73f411160c5a7
5
5
  SHA512:
6
- metadata.gz: b63730969612337646df343859d67d38e278f58fde0cd269d7126a8ab0194715cfdf0d7a8c26fec41b9bc0b52e6afc2119f5ae79e727be6b3f75cfa07df46e33
7
- data.tar.gz: 01c4bc741b0ea71de9efe7155d08d9a880910efe094c3d68da520073715aa2e20270e699964af8f523a2d9aa19bb16ec5bd8865964e20cc76d3664e35f2d216b
6
+ metadata.gz: eb20e68db43cb0ab2cecae4f10a349155072052db7e951d2f282b321a807e0609b35ab1947bde5780a37235b68d34fc2c97808aebf93da43d726a8d0dd21a8ba
7
+ data.tar.gz: 1accc8ca13f32ea3ead830443db771d73a9ef91dd696d21c02534c6153516ac972d5cc620d017a00d4c2d73d9d5bb94a5af3108067ea4159de48106c63dce8a1
data/README.md CHANGED
@@ -37,11 +37,13 @@ include Unidom::Accession::Concerns::AsPostFulfiller
37
37
  ```
38
38
 
39
39
  ### As Post Fulfilled concern
40
- The As Post Fulfilled concern do the following tasks for the includer automatically:
41
- 1. Define the has_many :post_fulfillments macro as: ``has_many :post_fulfillments, class_name: 'Unidom::Accession::PostFulfillment', as: :fulfilled``
42
- 2. Define the has_many :fulfiller_people macro as: ``has_many :fulfiller_people, through: :post_fulfillments, source: :fulfiller, source_type: 'Unidom::Party::Person'``
40
+ The As Post Fulfilled concern do the following tasks for the includer automatically:
41
+ 1. Define the has_many :post_fulfillments macro as: ``has_many :post_fulfillments, class_name: 'Unidom::Accession::PostFulfillment', as: :fulfilled``
42
+ 2. Define the has_many :fulfiller_people macro as: ``has_many :fulfiller_people, through: :post_fulfillments, source: :fulfiller, source_type: 'Unidom::Party::Person'``
43
+ 3. Define the #is_fulfilled_as_post! method as: ``def is_fulfilled_as_post!(by: fulfiller, opened_at: Time.now)``
43
44
 
44
45
  ### As Post Fulfiller concern
45
- The As Post Fulfiller concern do the following tasks for the includer automatically:
46
- 1. Define the has_many :post_fulfillments macro as: ``has_many :post_fulfillments, class_name: 'Unidom::Accession::PostFulfillment', as: :fulfiller``
47
- 2. Define the has_many :fulfilled_posts macro as: ``has_many :fulfilled_posts, through: :post_fulfillments, source: :fulfilled, source_type: 'Unidom::Position::Post'``
46
+ The As Post Fulfiller concern do the following tasks for the includer automatically:
47
+ 1. Define the has_many :post_fulfillments macro as: ``has_many :post_fulfillments, class_name: 'Unidom::Accession::PostFulfillment', as: :fulfiller``
48
+ 2. Define the has_many :fulfilled_posts macro as: ``has_many :fulfilled_posts, through: :post_fulfillments, source: :fulfilled, source_type: 'Unidom::Position::Post'``
49
+ 3.
@@ -7,9 +7,11 @@ module Unidom::Accession::Concerns::AsPostFulfilled
7
7
  has_many :post_fulfillments, class_name: 'Unidom::Accession::PostFulfillment', as: :fulfilled
8
8
  has_many :fulfiller_people, through: :post_fulfillments, source: :fulfiller, source_type: 'Unidom::Party::Person'
9
9
 
10
- #def is_fulfilled_as_post!(fulfiller, opened_at: Time.now)
11
- # post_fulfillments.create! fulfiller: fulfiller, opened_at: opened_at
12
- #end
10
+ def is_fulfilled_as_post!(by: nil, opened_at: Time.now)
11
+ raise ArgumentError.new('The argument "by" is required.') if by.blank?
12
+ raise ArgumentError.new('The argument "opened_at" is required.') if opened_at.blank?
13
+ post_fulfillments.create! fulfiller: by, opened_at: opened_at
14
+ end
13
15
 
14
16
  end
15
17
 
@@ -7,9 +7,11 @@ module Unidom::Accession::Concerns::AsPostFulfiller
7
7
  has_many :post_fulfillments, class_name: 'Unidom::Accession::PostFulfillment', as: :fulfiller
8
8
  has_many :fulfilled_posts, through: :post_fulfillments, source: :fulfilled, source_type: 'Unidom::Position::Post'
9
9
 
10
- #def fulfill_post!(fulfilled, opened_at: Time.now)
11
- # post_fulfillments.create! fulfilled: fulfilled, opened_at: opened_at
12
- #end
10
+ def fulfill_post!(post: nil, opened_at: Time.now)
11
+ raise ArgumentError.new('The argument "post" is required.') if post.blank?
12
+ raise ArgumentError.new('The argument "opened_at" is required.') if opened_at.blank?
13
+ post_fulfillments.create! fulfilled: post, opened_at: opened_at
14
+ end
13
15
 
14
16
  end
15
17
 
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Accession
3
- VERSION = '1.2'.freeze
3
+ VERSION = '1.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-accession
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: '1.3'
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-07-17 00:00:00.000000000 Z
11
+ date: 2016-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.9'
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '3.4'
34
- type: :development
35
- prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - ">="
39
25
  - !ruby/object:Gem::Version
40
- version: '3.4'
26
+ version: '0.9'
41
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
42
28
  The Accession domain model engine includes Post Fullfillment and its relative models.
43
29
  Unidom (统一领域对象模型)是一系列的领域模型引擎。就职领域模型引擎包括岗位履行及其相关的模型。