unidom-party 0.7 → 1.0

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: 369b0d1c532781d5663efea019098633e6a590f5
4
- data.tar.gz: 015b40cba67c84a9668bd5c600594f119e6a9971
3
+ metadata.gz: 67a8bd6c0c981432107923c5f27fe260e048ee3b
4
+ data.tar.gz: 6b8859ef7eee949110c71dd47e2b06ba260fca4b
5
5
  SHA512:
6
- metadata.gz: a79e6b07c6955096bcd7d8e73a22a1e6e4c3cda475771b19a697df73a3e3b467f95a23027b8910e1a110e1ca1dc5cd8815314a99df0bba5a56f1ff34f6f31fd8
7
- data.tar.gz: fad07c60a3861fd6f4c3c961e06709d3b4563201e97c8e72c9708451ab53c9cfcacf258127e6892f7b40aa0721ab898ac1b85ff39852a0d85d2e9a5dc0495827
6
+ metadata.gz: c7a338de187e17e6aa26d352a5a3042a10beb2bc1cd7222a14582afb958902e740fd9884ed3d45e390dca35177fd47f2cf8eb4a5baf78d1d5d4125c387e85961
7
+ data.tar.gz: cd226e1747df79f27a128b90e43375a96f33ff638a84ff8070ef7f503a6c342e84ebe47eeea67ddedb655f304f83bb5a510ad5189cfd3e3b93c91bbe3ba50aa2
data/README.md CHANGED
@@ -35,7 +35,7 @@ person.target_party_relations
35
35
  government_agency = Unidom::Party::GovernmentAgency.valid_at.alive.first
36
36
  government_agency.supervision_region
37
37
 
38
- relation = Unidom::Party::PartyRelation.relate! company, person, linkage_code: 'EMPL', grade: 0, priority: 0, opened_at: Time.now, attributes: {}
38
+ relation = Unidom::Party::PartyRelation.relate! source_party: company, target_party: person, linkage_code: 'EMPL', grade: 0, priority: 0, opened_at: Time.now, attributes: {}
39
39
  # The company employs the person
40
40
 
41
41
  Unidom::Party::PartyRelation.source_party_is(company).target_party_is(person).valid_at.alive
@@ -15,21 +15,10 @@ class Unidom::Party::PartyRelation < ActiveRecord::Base
15
15
  scope :source_party_is, ->(source_party) { where source_party: source_party }
16
16
  scope :target_party_is, ->(target_party) { where target_party: target_party }
17
17
 
18
- def self.relate(source_party, target_party, linkage_code: 'FRND', grade: 0, opened_at: Time.now, priority: 0, attributes: {})
18
+ def self.relate!(source_party: nil, target_party: nil, linkage_code: 'FRND', grade: 0, opened_at: Time.now, priority: 0, attributes: {})
19
19
  relation = source_party_is(source_party).target_party_is(target_party).linkage_coded_as(linkage_code).first_or_initialize grade: grade, priority: priority, opened_at: opened_at
20
20
  relation.assign_attributes attributes
21
21
  relation.save!
22
- relation
23
- end
24
-
25
- def self.relate!(source_party, target_party, linkage_code: 'FRND', grade: 0, opened_at: Time.now, priority: 0, attributes: {})
26
- relation = source_party_is(source_party).target_party_is(target_party).linkage_coded_as(linkage_code).first_or_initialize grade: grade, priority: priority, opened_at: opened_at
27
- relation.assign_attributes attributes
28
- relation.save!
29
- end
30
-
31
- class << self
32
- deprecate relate: :relate!, deprecator: ActiveSupport::Deprecation.new('1.0', 'unidom-party')
33
22
  end
34
23
 
35
24
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Party
3
- VERSION = '0.7'.freeze
3
+ VERSION = '1.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-party
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
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-07-21 00:00:00.000000000 Z
11
+ date: 2016-08-03 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
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.9'
27
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.