unidom-contact 1.3 → 1.3.1

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: 1bb8c1c4bdc3a86388a814536a16e4f9b8ba82f9
4
- data.tar.gz: 1f4d011717a2e97db9fcdfe03bed37ea657055bf
3
+ metadata.gz: 7820e3b26fd0f497242c4b7267d2a4747426f719
4
+ data.tar.gz: ef251ac7c7c2709fd65e248082b8783032d95252
5
5
  SHA512:
6
- metadata.gz: b7df296b4b00638a8c727b5a425fdf6039e914bc984bd4199baabc48902b304474642b195b457386cfc11a3fb3e32f30bc2d53fc5a1a3a826c59a655a46312a6
7
- data.tar.gz: 713ecf0b3d6b4578781c6bda6fba35fc70f3ef65686ba7a78d48b57b2e3c46dd2fba925da826e14b94185552ece1111209ba0a9b8f2e9b721851eb887cc9d3f9
6
+ metadata.gz: 5bab15c102d9bd750ed3648af4201bbea2f8964da173b3c8ca332a61b709f7b8b00f516d3d672d5dd91deea278e350164ef2bfa78837513aa467409077c22e98
7
+ data.tar.gz: 10f5068a072f52394dacfa8f385a1225aaaed90ae0808a32f208682cf146627699ce8b37485a7a32221971697df4c7cc556bcf867b2dd0073a6d227bb54edc05
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-contact.svg)](https://badge.fury.io/rb/unidom-contact)
5
+ [![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-contact.svg)](https://gemnasium.com/github.com/topbitdu/unidom-contact)
5
6
 
6
7
  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
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-contact'
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 200103.
23
33
 
34
+
35
+
24
36
  ## Call the Model
37
+
25
38
  ```ruby
26
39
  contact = Unidom::Contact::China::MobilePhoneNumber.phone_number_is('13912345678').valid_at.alive.first_or_create!
27
40
  subscriber = Unidom::Party::Person.create! name: 'John'
@@ -41,7 +54,10 @@ Unidom::Contact::EmailAddress.full_address_is('topbit.du@gmail.com').first
41
54
 
42
55
  ```
43
56
 
57
+
58
+
44
59
  ## Include the Concerns
60
+
45
61
  ```ruby
46
62
  include Unidom::Contact::Concerns::AsContact
47
63
  include Unidom::Contact::Concerns::AsSubscriber
@@ -49,18 +65,21 @@ include Unidom::Contact::Concerns::AsEmailAddressSubscriber
49
65
  ```
50
66
 
51
67
  ### As Contact concern
52
- The As Contact concern do the following tasks for the includer automatically:
53
- 1. Define the has_many :contact_subscriptions macro as: ``has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :contact``
54
- 2. Define the #is_subscribed_as_contact! method as: ``is_subscribed_as_contact!(by: nil, at: Time.now, name: by.try(:name), primary: true)``
68
+
69
+ The As Contact concern do the following tasks for the includer automatically:
70
+ 1. Define the has_many :contact_subscriptions macro as: ``has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :contact``
71
+ 2. Define the #is_subscribed_as_contact! method as: ``is_subscribed_as_contact!(by: nil, at: Time.now, name: by.try(:name), primary: true)``
55
72
  3. Define the #is_subscribed_as_contact? method as: ``is_subscribed_as_contact?(by: nil, at: Time.now, primary: true)``
56
73
 
57
74
  ### As Subscriber concern
58
- The As Subscriber concern do the following tasks for the includer automatically:
59
- 1. Define the has_many :contact_subscriptions macro as: ``has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :subscriber``
60
- 2. Define the #subscribe_contact! method as: ``subscribe_contact!(contact, at: Time.now, name: nil, primary: true)``
75
+
76
+ The As Subscriber concern do the following tasks for the includer automatically:
77
+ 1. Define the has_many :contact_subscriptions macro as: ``has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :subscriber``
78
+ 2. Define the #subscribe_contact! method as: ``subscribe_contact!(contact, at: Time.now, name: nil, primary: true)``
61
79
  3. Define the #subscribe_contact? method as: ``subscribe_contact?(contact, at: Time.now, primary: true)``
62
80
 
63
81
  ### As Email Address Subscriber concern
64
- The As Email Address Subscriber concern do the following tasks for the includer automatically:
65
- 1. Include the As Subscriber concern
82
+
83
+ The As Email Address Subscriber concern do the following tasks for the includer automatically:
84
+ 1. Include the As Subscriber concern
66
85
  2. Define the has_many :email_addresses macro as: ``has_many :email_addresses, through: :contact_subscriptions, source: :contact, source_type: 'Unidom::Contact::EmailAddress'``
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
10
10
  rdoc.rdoc_dir = 'rdoc'
11
11
  rdoc.title = 'Unidom Contact'
12
12
  rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.rdoc')
13
+ rdoc.rdoc_files.include('README.md')
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
@@ -20,5 +20,5 @@ load 'rails/tasks/statistics.rake'
20
20
 
21
21
 
22
22
 
23
- Bundler::GemHelper.install_tasks
23
+ require 'bundler/gem_tasks'
24
24
 
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/unidom/contact .js
2
+ //= link_directory ../stylesheets/unidom/contact .css
@@ -5,7 +5,7 @@
5
5
  // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
9
  //
10
10
  // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
@@ -6,9 +6,9 @@
6
6
  * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
7
  *
8
8
  * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
12
  *
13
13
  *= require_self
14
14
  */
@@ -1,2 +1,3 @@
1
1
  class Unidom::Contact::ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
2
3
  end
@@ -0,0 +1,2 @@
1
+ class Unidom::Contact::ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class Unidom::Contact::ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class Unidom::Contact::ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -1,6 +1,6 @@
1
1
  # Contact Subscription 是联系方式和参与者之间的关联关系。
2
2
 
3
- class Unidom::Contact::ContactSubscription < ActiveRecord::Base
3
+ class Unidom::Contact::ContactSubscription < Unidom::Contact::ApplicationRecord
4
4
 
5
5
  self.table_name = 'unidom_contact_subscriptions'
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Email Address 是电子邮箱地址。
2
2
 
3
- class Unidom::Contact::EmailAddress < ActiveRecord::Base
3
+ class Unidom::Contact::EmailAddress < Unidom::Contact::ApplicationRecord
4
4
 
5
5
  self.table_name = 'unidom_email_addresses'
6
6
 
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Contact
3
- VERSION = '1.3'.freeze
3
+ VERSION = '1.3.1'.freeze
4
4
  end
5
5
  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: '1.3'
4
+ version: 1.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-09-09 00:00:00.000000000 Z
11
+ date: 2016-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '1.6'
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
- version: '1.0'
26
+ version: '1.6'
27
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
28
28
  The Contact domain model engine includes Contact Subscription and Email Address
29
29
  models. Unidom (统一领域对象模型)是一系列的领域模型引擎。联系方式领域模型引擎包括联系方式订阅和电子邮箱地址的模型。
@@ -36,10 +36,14 @@ files:
36
36
  - MIT-LICENSE
37
37
  - README.md
38
38
  - Rakefile
39
+ - app/assets/config/unidom-contact_manifest.js
39
40
  - app/assets/javascripts/unidom/contact/application.js
40
41
  - app/assets/stylesheets/unidom/contact/application.css
41
42
  - app/controllers/unidom/contact/application_controller.rb
42
43
  - app/helpers/unidom/contact/application_helper.rb
44
+ - app/jobs/unidom/contact/application_job.rb
45
+ - app/mailers/unidom/contact/application_mailer.rb
46
+ - app/models/unidom/contact/application_record.rb
43
47
  - app/models/unidom/contact/concerns/as_contact.rb
44
48
  - app/models/unidom/contact/concerns/as_email_address_subscriber.rb
45
49
  - app/models/unidom/contact/concerns/as_subscriber.rb