unidom-contact 0.3 → 0.3.1
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 +4 -4
- data/README.md +5 -1
- data/app/models/unidom/contact/contact_subscription.rb +2 -2
- data/lib/unidom/contact/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 07f1b0835313aa8ca9a709a31cbe486da71c57c9
|
|
4
|
+
data.tar.gz: 713db3fc0abd766caaaf9ee338bfadd5cee4db18
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca596562337dc54bfc82e1ff37de3775c7361b49253e41bf454eeccfdb4b0cba8e6d8838074d51bc5e313933c64e1d49927c629f213e21219568e8875b1e26a1
|
|
7
|
+
data.tar.gz: 8540737f5f07e5e3f5caa99828eba87db2754031d4e775a8a440e33eaedd47ddbfc080e39d19bb82531bc898b93cf88b17413b3e98cb352de8239cf1fa3367fe
|
data/README.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Contact domain model engine includes Contact Subscription and Email Address models.
|
|
7
7
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。联系方式领域模型引擎包括联系方式订阅和电子邮箱地址的模型。
|
|
8
8
|
|
|
9
|
+
## Recent Update
|
|
10
|
+
Check out the [Road Map](ROADMAP.md) to find out what's the next.
|
|
11
|
+
Check out the [Change Log](CHANGELOG.md) to find out what's new.
|
|
12
|
+
|
|
9
13
|
## Usage in Gemfile
|
|
10
14
|
```ruby
|
|
11
15
|
gem 'unidom-contact'
|
|
@@ -20,7 +24,7 @@ rake db:migrate
|
|
|
20
24
|
```ruby
|
|
21
25
|
contact = MobilePhoneNumber.create phone_number: '13912345678'
|
|
22
26
|
subscriber = Person.create name: 'John'
|
|
23
|
-
subscription = Unidom::Contact::ContactSubscription.subscribe contact, subscriber, name: 'John Mobile', primary: true, grade: 0, priority: 0
|
|
27
|
+
subscription = Unidom::Contact::ContactSubscription.subscribe contact, subscriber, name: 'John Mobile', primary: true, grade: 0, priority: 0, opened_at: Time.now
|
|
24
28
|
# Associate the subscriber & the contact
|
|
25
29
|
|
|
26
30
|
Unidom::Contact::ContactSubscription.subscribed_by(subscriber).valid_at.alive
|
|
@@ -16,8 +16,8 @@ class Unidom::Contact::ContactSubscription < ActiveRecord::Base
|
|
|
16
16
|
|
|
17
17
|
include Unidom::Common::Concerns::ModelExtension
|
|
18
18
|
|
|
19
|
-
def self.subscribe(contact, subscriber, name: subscriber.name, primary: false, grade: 0, priority: 0)
|
|
20
|
-
contact_is(contact).subscribed_by(subscriber).valid_at.alive.first_or_create name: name, elemental: primary, grade: grade, priority: priority, opened_at:
|
|
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
21
|
end
|
|
22
22
|
|
|
23
23
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unidom-contact
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.3.1
|
|
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-03-
|
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: unidom-common
|