devise_invitable 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of devise_invitable might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b83b5f1ceec909cc73063d89575fce5bcf50c473
4
- data.tar.gz: f495b7eeebe7e5c70d3181747b25ea802a8f656f
3
+ metadata.gz: 24a36c592f8c636eb4cf7e704165f41abc0c14c5
4
+ data.tar.gz: 9a999cc7bc9523e1b100ce415aee6270d8a9fc66
5
5
  SHA512:
6
- metadata.gz: d27498b5bf7c89b29d8cb15b34df681a3aa3fdbb639ee6b73cbb93eaf61eccc5ff255b6016447d57b8b1ee54bd2fa6bd54d23c79f107d4dff21fe70b3489bcb8
7
- data.tar.gz: cc70998322befe8502e6787d863e9ce0569d3c718eac7c6f7c31dcf17a0f1ad665eaf83f46ffb64719c961b20e8cfe968624d953387b04a0ed062bea42dc602d
6
+ metadata.gz: ca000182ea194f46655066899e531094801c347461926d8185fa8a039208af55d108c6a35cad22bfa31e60d7cad63b62203cf18b9e39a43702dcedd815cb9c33
7
+ data.tar.gz: 66e68e6a7facedfdb0752f4d4b1310e255cdcd33892f816158149154e94a2104d71b88a80af3672fd9a325984666770c66cf115a85758e7b57273d9ef3bee00a
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ = 1.7.2
2
+ - Sign out before accepting the invitation if the user logged in
3
+
1
4
  = 1.7.1
2
5
  - Allow to set invited_by_* options on model
3
6
  - created_by_invite scope and test method checks invitation_created_at, because invitation_sent_at can be nil if skip_invitation is used
data/README.rdoc CHANGED
@@ -70,7 +70,7 @@ or for a model that already exists, define a migration to add DeviseInvitable to
70
70
  add_column :users, :invited_by_id, :integer
71
71
  add_column :users, :invited_by_type, :string
72
72
  add_index :users, :invitation_token, :unique => true
73
-
73
+
74
74
  # Allow null encrypted_password
75
75
  change_column_null :users, :encrypted_password, :string, true
76
76
  # Allow null password_salt (add it if you are using Devise's encryptable module)
@@ -229,7 +229,7 @@ Here is an example of what your application controller might need to include in
229
229
 
230
230
  === Send an invitation
231
231
 
232
- To send an invitation to a user, use the <tt>invite!</tt> class method. <tt>:email</tt> must be present in the parameters hash. You can also include other attributes in the hash. The record will not be validated.
232
+ To send an invitation to a user, use the <tt>invite!</tt> class method. <b>Note: This will create a user, and send an email for the invite.</b> <tt>:email</tt> must be present in the parameters hash. You can also include other attributes in the hash. The record will not be validated.
233
233
 
234
234
  User.invite!(:email => "new_user@example.com", :name => "John Doe")
235
235
  # => an invitation email will be sent to new_user@example.com
@@ -267,15 +267,17 @@ To check if a particular user is created by invitation, irrespective to state of
267
267
  When using skip_invitation you must send the email with the user object instance that generated the tokens, as
268
268
  user.raw_invitation_token is available only to the instance and is not persisted in the database.
269
269
 
270
+ You can also set <tt>invited_by</tt> when using the <tt>invite!</tt> class method:
271
+
272
+ User.invite!({:email => "new_user@example.com"}, current_user) # current_user will be set as invited_by
273
+
274
+ === Sending an invitation after user creation
275
+
270
276
  You can send an invitation to an existing user if your workflow creates them separately:
271
277
 
272
278
  user = User.find(42)
273
279
  user.invite!(current_user) # current user is optional to set the invited_by attribute
274
280
 
275
- You can also set <tt>invited_by</tt> when using the <tt>invite!</tt> class method:
276
-
277
- User.invite!({:email => "new_user@example.com"}, current_user) # current_user will be set as invited_by
278
-
279
281
  === Find by invitation token
280
282
 
281
283
  To find by invitation token use the <tt>find_by_invitation_token</tt> class method.
@@ -44,6 +44,7 @@ class Devise::InvitationsController < DeviseController
44
44
 
45
45
  # GET /resource/invitation/accept?invitation_token=abcdef
46
46
  def edit
47
+ sign_out send("current_#{resource_name}") if send("#{resource_name}_signed_in?")
47
48
  set_minimum_password_length
48
49
  resource.invitation_token = params[:invitation_token]
49
50
  render :edit
@@ -1,3 +1,3 @@
1
1
  module DeviseInvitable
2
- VERSION = '1.7.1'
2
+ VERSION = '1.7.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_invitable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-17 00:00:00.000000000 Z
11
+ date: 2017-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  version: 1.3.6
164
164
  requirements: []
165
165
  rubyforge_project:
166
- rubygems_version: 2.5.1
166
+ rubygems_version: 2.6.10
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: An invitation strategy for Devise