unidom-visitor 0.1 → 0.1.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: e641cf324c2fb45f41dfce8e6f372008f43acc90
4
- data.tar.gz: cd1ff7e5604974336ff574488ca4d526f4d23569
3
+ metadata.gz: d59a0fb39173914d2333b53ff96c8de56db42ef3
4
+ data.tar.gz: 454f6abc996528d7e194fc89a2bfbc4f243cc403
5
5
  SHA512:
6
- metadata.gz: 2bdda625df72006e1e1770aa82d5520de0bf2ce657bbbf2499e2d97616fd484c1dd3c9215dbd378d673c8d4861fb7c79032be4aea7799e7630ebbe2da153575f
7
- data.tar.gz: 46aad786b8be29d8ba8c244b674813f76f2de6a9808bbd2578f5f1534b76cf99481170ca6b223d08741a08a26a6e3e81eaae3fb4caa08f2660aacea035464d61
6
+ metadata.gz: e3a1656114518bca1f46b4b1cd124e4ef792242f47a9b7f364ec6e1a56af0e65d7b9f6849a2082eb194108926cc50d55eb15e21ae62e6f63c747b44678779f81
7
+ data.tar.gz: 7f16820fbcf02c695ec5a325f2d4765a2fedfd19efb0cde01701aa5455b8b9cb7ea77263b633d2a25e40fb257dd536dce215c1844e980786fa7ef7c3cb201fa6
data/README.md CHANGED
@@ -1,23 +1,24 @@
1
- # Unidom Visitor
1
+ # Unidom Visitor 访问者领域模型引擎
2
2
 
3
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-visitor.svg)](https://badge.fury.io/rb/unidom-visitor)
4
5
 
5
6
  Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Visitor domain model engine includes User, Guest, Administrator, and Password models.
6
7
  Unidom (统一领域对象模型)是一系列的领域模型引擎。访问者领域模型引擎包括用户、游客、管理员和密码的模型。
7
8
 
8
- ## Usage in Gemfile:
9
+ ## Usage in Gemfile
9
10
  ```ruby
10
11
  gem 'unidom-visitor'
11
12
  ```
12
13
 
13
- ## Run the Database Migration:
14
+ ## Run the Database Migration
14
15
  ```shell
15
16
  rake db:migrate
16
17
  ```
17
18
 
18
- ## Call the Model:
19
+ ## Call the Model
19
20
  ```ruby
20
- Unidom::Visitor::User.valid_at.alive.first
21
+ Unidom::Visitor::User.sign_up mobile_phone_number_entity, 'password'
21
22
  Unidom::Visitor::Guest.valid_at.alive.first
22
23
  Unidom::Visitor::User.valid_at.alive.first.passwords.valid_at.alive.first.merge(Unidom::Visitor::Authenticating.valid_at.alive).first
23
24
  ```
@@ -12,7 +12,7 @@ class Unidom::Visitor::Authenticating < ActiveRecord::Base
12
12
  scope :visitor_is, ->(visitor) { where visitor: visitor }
13
13
  scope :credential_is, ->(credential) { where credential: credential }
14
14
 
15
- include ::Unidom::Common::Concerns::ModelExtension
15
+ include Unidom::Common::Concerns::ModelExtension
16
16
 
17
17
  def self.authenticate(visitor, credential)
18
18
  self.create! visitor: visitor, credential: credential, opened_at: Time.now
@@ -8,6 +8,6 @@ class Unidom::Visitor::Guest < ActiveRecord::Base
8
8
 
9
9
  scope :platform_specific_identification_is, ->(platform_specific_identification) { where platform_specific_identification: platform_specific_identification }
10
10
 
11
- include ::Unidom::Common::Concerns::ModelExtension
11
+ include Unidom::Common::Concerns::ModelExtension
12
12
 
13
13
  end
@@ -10,7 +10,7 @@ class Unidom::Visitor::Identificating < ActiveRecord::Base
10
10
  scope :identity_is, ->(identity) { where identity: identity }
11
11
  scope :visitor_is, ->(visitor) { where visitor: visitor }
12
12
 
13
- include ::Unidom::Common::Concerns::ModelExtension
13
+ include Unidom::Common::Concerns::ModelExtension
14
14
 
15
15
  def self.find_identity(visitor)
16
16
  visitor_is(visitor).first.try :identity
@@ -6,7 +6,7 @@ class Unidom::Visitor::Password < ActiveRecord::Base
6
6
 
7
7
  has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential
8
8
 
9
- include ::Unidom::Common::Concerns::ModelExtension
9
+ include Unidom::Common::Concerns::ModelExtension
10
10
 
11
11
  def generate_pepper_content
12
12
  self.pepper_content = self.pepper_content||::SecureRandom.hex(self.class.columns_hash['pepper_content'].limit/2)
@@ -2,7 +2,7 @@
2
2
 
3
3
  class Unidom::Visitor::Recognization < ActiveRecord::Base
4
4
 
5
- self.table = 'unidom_recognizations'
5
+ self.table_name = 'unidom_recognizations'
6
6
 
7
7
  belongs_to :visitor, polymorphic: true
8
8
  belongs_to :party, polymorphic: true
@@ -10,7 +10,7 @@ class Unidom::Visitor::Recognization < ActiveRecord::Base
10
10
  scope :visitor_is, ->(visitor) { where visitor: visitor }
11
11
  scope :party_is, ->(party) { where party: party }
12
12
 
13
- include ::Unidom::Common::Concerns::ModelExtension
13
+ include Unidom::Common::Concerns::ModelExtension
14
14
 
15
15
  def self.cognize(visitor, party)
16
16
  raise 'Visitor can not be null.' if visitor.blank?
@@ -13,7 +13,7 @@ class Unidom::Visitor::User < ActiveRecord::Base
13
13
 
14
14
  scope :identified_by, ->(identity) { joins(:identificatings).merge(::Unidom::Visitor::Identificating.identity_is identity) }
15
15
 
16
- include ::Unidom::Common::Concerns::ModelExtension
16
+ include Unidom::Common::Concerns::ModelExtension
17
17
 
18
18
  def self.sign_up(identity, password)
19
19
 
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Visitor
3
- VERSION = '0.1'.freeze
3
+ VERSION = '0.1.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-visitor
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.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-01-26 00:00:00.000000000 Z
11
+ date: 2016-03-18 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: '0.2'
19
+ version: '0.5'
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: '0.2'
26
+ version: '0.5'
27
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
28
28
  The Visitor domain model engine includes User, Guest, Administrator, and Password
29
29
  models. Unidom (统一领域对象模型)是一系列的领域模型引擎。访问者领域模型引擎包括用户、游客、管理员和密码的模型。
@@ -81,6 +81,5 @@ rubyforge_project:
81
81
  rubygems_version: 2.4.5.1
82
82
  signing_key:
83
83
  specification_version: 4
84
- summary: The Visitor domain model engine includes User, Guest, Administrator, and
85
- Password models.
84
+ summary: Unidom Visitor Domain Model Engine 访问者领域模型引擎
86
85
  test_files: []