unidom-contact 0.1 → 0.2

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: 79f378985c985c223387ea66e346c1ad05fa24b1
4
- data.tar.gz: 94f7cb4ab404d8993f912f4713643e40e805d0e2
3
+ metadata.gz: 460f49f73d43bd505a2e7c7653bfb7925e3a11a2
4
+ data.tar.gz: 79ac76121185d0df60ea9fb79010221d14c04e7d
5
5
  SHA512:
6
- metadata.gz: 8c8a6e26f8cd017b39c8f8251aa3cbbaf3dd2fcb2370774744ed03ceb4f38f5f2d3f0caa01534f2637fe4c2cf3ab2f0def51aa1b24ab2932b65d22443f862bd8
7
- data.tar.gz: 45e009c202322aacd132d2bf38c049b28d65847e4620f79ae2f00878740bc657370bc765db438fc40f30e933124fd9d71673bd26fb422b104d45a4bf2d161a69
6
+ metadata.gz: 495ca251c7c37284144f103962e16d1fc23c13f639c63a52cd156044dcb3b2c6ffc2daae606df57e0a0ebdd63b56dd6542034e38d8e1e7a6ec18b1cce2c87b0f
7
+ data.tar.gz: 48874bd6794fb065d272ff654cde98976c938a4cb658afd9ad8590e5052a508582ebaa780b12ff6fa27998b89fea162fdc3aa62dfe8406c4d9d9cfb9f03442c5
data/README.md CHANGED
@@ -1,19 +1,22 @@
1
- # Unidom Contact
1
+ # Unidom Contact 联系方式领域模型引擎
2
+
3
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
4
+ [![Gem Version](https://badge.fury.io/rb/unidom-contact.svg)](https://badge.fury.io/rb/unidom-contact)
2
5
 
3
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.
4
7
  Unidom (统一领域对象模型)是一系列的领域模型引擎。联系方式领域模型引擎包括联系方式订阅和电子邮箱地址的模型。
5
8
 
6
- ## Usage in Gemfile:
9
+ ## Usage in Gemfile
7
10
  ```ruby
8
11
  gem 'unidom-contact'
9
12
  ```
10
13
 
11
- ## Run the Database Migration:
14
+ ## Run the Database Migration
12
15
  ```shell
13
16
  rake db:migrate
14
17
  ```
15
18
 
16
- ## Call the Model:
19
+ ## Call the Model
17
20
  ```ruby
18
21
  Unidom::Contact::ContactSubscription.subscribed_by(subscriber).valid_at.alive.first
19
22
  Unidom::Contact::EmailAddress.full_address_is('topbit.du@gmail.com').first
@@ -14,4 +14,6 @@ class Unidom::Contact::ContactSubscription < ActiveRecord::Base
14
14
  scope :contact_is, ->(contact) { where contact: contact }
15
15
  scope :subscribed_by, ->(subscriber) { where subscriber: subscriber }
16
16
 
17
+ include Unidom::Common::Concerns::ModelExtension
18
+
17
19
  end
@@ -15,6 +15,8 @@ class Unidom::Contact::EmailAddress < ActiveRecord::Base
15
15
  scope :local_part_is, ->(local_part) { where local_part: local_part }
16
16
  scope :domain_part_is, ->(domain_part) { where domain_part: domain_part }
17
17
 
18
+ include Unidom::Common::Concerns::ModelExtension
19
+
18
20
  before_validation do
19
21
  self.full_address.strip!
20
22
  self.personalized_name = self.full_address if self.personalized_name.blank?
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Contact
3
- VERSION = '0.1'.freeze
3
+ VERSION = '0.2'.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: '0.1'
4
+ version: '0.2'
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-01-22 00:00:00.000000000 Z
11
+ date: 2016-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -73,6 +73,5 @@ rubyforge_project:
73
73
  rubygems_version: 2.4.5.1
74
74
  signing_key:
75
75
  specification_version: 4
76
- summary: The Contact domain model engine includes Contact Subscription and Email Address
77
- models.
76
+ summary: Unidom Contact Domain Model Engine 联系方式领域模型引擎
78
77
  test_files: []