unidom-visitor 1.2 → 1.3

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: a04ab37eb00f37113ccd0f040ee2274c0b0f4e07
4
- data.tar.gz: 831caea39439818ded903fac9b01df871192aa59
3
+ metadata.gz: b8d773962937ec0d9982d0d06a3a60a20d60f564
4
+ data.tar.gz: 9962fce0d00f6eb63f8d66b85806a8c35e3adcf2
5
5
  SHA512:
6
- metadata.gz: b2c0e2fdc34366a948e95735e331ebedc92539301027e0e342bf7859844133160c97f6788942bbb5569e9ce0239a50b4ac40e606c2c3d179f541ab28d1fef243
7
- data.tar.gz: ad1059566f9d92acd833310e92d3bb20d0b0b311c28ca7e885474962e4e7a273f5fb7e02383af42d40aba9456b35976b2fced22802a3e4a7ef646d0964f36af4
6
+ metadata.gz: 1ceb13ad71b2014f99b451c4124656bf241f71f2f2a2d779f61804fef5e4fe54db40db83002dd5fb1dd0c5acba8be9069baa2692940498df65fea7e43f5ce0c8
7
+ data.tar.gz: 44a9af0960256f06835c34439e1f53983a163ee3c8bf0f46d2948c61a74f60f5289cba5224664fafeab8ee23e9ba6210c00511eca0fafa94994895bb49e79859
data/README.md CHANGED
@@ -78,6 +78,7 @@ Unidom::Visitor::Recognization.cognize! user, as: person
78
78
  ## Inlcude the Concerns
79
79
  ```ruby
80
80
  include Unidom::Visitor::Concerns::AsVisitor
81
+ include Unidom::Visitor::Concerns::AsIdentity
81
82
  include Unidom::Visitor::Concerns::AsCredential
82
83
  ```
83
84
 
@@ -89,6 +90,10 @@ The As Visitor concern do the following tasks for the includer automatically:
89
90
  4. Define the .identified_by scope as: ``scope :identified_by, ->(identity) { joins(:identificatings).merge(Unidom::Visitor::Identificating.identity_is identity) }``
90
91
  5. Define the .sign_up method as: ``sign_up(identity, password: nil, opened_at: Time.now)``
91
92
 
93
+ ### As Identity concern
94
+ The As Identity concern do the following tasks for the includer automatically:
95
+ 1. Define the has_many :identificatings macro as: ``has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :identity``
96
+
92
97
  ### As Credential concern
93
98
  The As Credential concern do the following tasks for the includer automatically:
94
99
  1. Define the has_one :authenticatings macro as: ``has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential``
@@ -0,0 +1,14 @@
1
+ module Unidom::Visitor::Concerns::AsIdentity
2
+
3
+ extend ActiveSupport::Concern
4
+
5
+ included do |includer|
6
+
7
+ has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :identity
8
+
9
+ end
10
+
11
+ module ClassMethods
12
+ end
13
+
14
+ end
@@ -4,15 +4,6 @@ class Unidom::Visitor::User < ActiveRecord::Base
4
4
 
5
5
  self.table_name = 'unidom_users'
6
6
 
7
- #has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :visitor
8
-
9
- #has_many :authenticatings, class_name: 'Unidom::Visitor::Authenticating', as: :visitor
10
- #has_many :passwords, through: :authenticatings, source: :credential, source_type: 'Unidom::Visitor::Password'
11
-
12
- #has_many :recognizations, class_name: 'Unidom::Visitor::Recognization', as: :visitor
13
-
14
- #scope :identified_by, ->(identity) { joins(:identificatings).merge(Unidom::Visitor::Identificating.identity_is identity) }
15
-
16
7
  include Unidom::Common::Concerns::ModelExtension
17
8
  include Unidom::Visitor::Concerns::AsVisitor
18
9
 
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Visitor
3
- VERSION = '1.2'.freeze
3
+ VERSION = '1.3'.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: '1.2'
4
+ version: '1.3'
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-10-02 00:00:00.000000000 Z
11
+ date: 2016-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -42,6 +42,7 @@ files:
42
42
  - app/helpers/unidom/visitor/application_helper.rb
43
43
  - app/models/unidom/visitor/authenticating.rb
44
44
  - app/models/unidom/visitor/concerns/as_credential.rb
45
+ - app/models/unidom/visitor/concerns/as_identity.rb
45
46
  - app/models/unidom/visitor/concerns/as_visitor.rb
46
47
  - app/models/unidom/visitor/guest.rb
47
48
  - app/models/unidom/visitor/identificating.rb