unidom-contact 0.4 → 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: fd78d306addda5897a851c79dea9b58c71c262c1
4
- data.tar.gz: 5063ba74436f72e4bd44aadf5878aa4faf9686e8
3
+ metadata.gz: 6fb166f84941173fe4d9aa50536d25636fb5fd4b
4
+ data.tar.gz: 57c0e611f5a3b4ca872976e0b75b2f2e3c513b9f
5
5
  SHA512:
6
- metadata.gz: aead0014470362276c6ddf34a64d4834046dd5fd109772fd34dd00029b720f1083ad0c404bddba9282c52ea1d018653ac7f88a684761bba025ff15ccb01b721c
7
- data.tar.gz: 7bfc13067d9eec3fac556cc390bce218f70d5555ac8e7854f13ab99d9013c3479b99845c1cde51ecbeb702a739bcb1e1135bbeadf61ac13fc58a9f5635fd728b
6
+ metadata.gz: aca180708fe6d9420190d6ff7c902b4a2ede2b4c9439f61b8da94127495e7068582237cd9bc7b7b3d6923c7c5b9630b682d85355c03b34850b4938c4c6fa665d
7
+ data.tar.gz: 55cc326f6a8e5e5b35738186ced5588633e18db637592ba5a18762899e615afb80e91acbb4c5bdf575f1f6d3f2e4f650cddd2c10fcf9dd598fc8c42d96611245
data/README.md CHANGED
@@ -25,7 +25,9 @@ The migration versions start with 200103.
25
25
  ```ruby
26
26
  contact = Unidom::Contact::China::MobilePhoneNumber.phone_number_is('13912345678').valid_at.alive.first_or_create!
27
27
  subscriber = Unidom::Party::Person.create! name: 'John'
28
- subscription = Unidom::Contact::ContactSubscription.subscribe! contact, subscriber, 'John Mobile', true, 0, 0, Time.now
28
+ subscription = Unidom::Contact::ContactSubscription.subscribe! contact: contact, subscriber: subscriber, name: 'John Mobile', primary: true, grade: 0, priority: 0, opened_at: Time.now
29
+ # or
30
+ subscription = Unidom::Contact::ContactSubscription.subscribe! contact: contact, subscriber: subscriber
29
31
  # Associate the subscriber & the contact
30
32
 
31
33
  Unidom::Contact::ContactSubscription.subscribed_by(subscriber).valid_at.alive
@@ -16,16 +16,16 @@ class Unidom::Contact::ContactSubscription < ActiveRecord::Base
16
16
  scope :contact_is, ->(contact) { where contact: contact }
17
17
  scope :subscribed_by, ->(subscriber) { where subscriber: subscriber }
18
18
 
19
- def self.subscribe(contact, subscriber, name: subscriber.name, primary: false, grade: 0, priority: 0, opened_at: Time.now)
20
- contact_is(contact).subscribed_by(subscriber).valid_at.alive.first_or_create name: name, elemental: primary, grade: grade, priority: priority, opened_at: opened_at
21
- end
19
+ #def self.subscribe(contact, subscriber, name: subscriber.name, primary: false, grade: 0, priority: 0, opened_at: Time.now)
20
+ # contact_is(contact).subscribed_by(subscriber).valid_at.alive.first_or_create name: name, elemental: primary, grade: grade, priority: priority, opened_at: opened_at
21
+ #end
22
22
 
23
- def self.subscribe!(contact, subscriber, name = subscriber.name, primary = false, grade = 0, priority = 0, opened_at = Time.now)
23
+ def self.subscribe!(contact: nil, subscriber: nil, name: subscriber.name, primary: false, grade: 0, priority: 0, opened_at: Time.now)
24
24
  contact_is(contact).subscribed_by(subscriber).valid_at.alive.first_or_create! name: name, elemental: primary, grade: grade, priority: priority, opened_at: opened_at
25
25
  end
26
26
 
27
- class << self
28
- deprecate subscribe: :subscribe!, deprecator: ActiveSupport::Deprecation.new('1.0', 'unidom-contact')
29
- end
27
+ #class << self
28
+ # deprecate subscribe: :subscribe!, deprecator: ActiveSupport::Deprecation.new('1.0', 'unidom-contact')
29
+ #end
30
30
 
31
31
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Contact
3
- VERSION = '0.4'.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-contact
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
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.