devise_invitable 1.5.0 → 1.5.1

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: 9ebdddd2e1426fdde9ad700f7f60e4cedf3e48ab
4
- data.tar.gz: 3a783c0d76c73a4a6af2c07cda15b80904fecdcf
3
+ metadata.gz: 09f7285fbf0dcc7da0b16e9a26bbc9c385e19720
4
+ data.tar.gz: 0b862b791cd58df3fc8ad6eba813c76534e89cba
5
5
  SHA512:
6
- metadata.gz: b85b1eabee1011a5175f98ca92f05f39a1f49e3da2666f17bafa8a87d22115700d6f7beee89261a5096d70dcfeec473834dc43bfcaa5a967b63fc78b7789bb7f
7
- data.tar.gz: 483b574690f8a3064b7d4f941a7fad4e321fe89d677192b82e68d0d0f3feba49d92125054f17e89521c2810e9feb80de12ee135895728d7d1f633bdd845845ea
6
+ metadata.gz: 8bf23dd018217299609a033f0ea3666a4f0358580a6b2a14bff4405666ae82217de809b1fdac77a12269349337d8756a601c635e427962fa343c81d4bdf0c765
7
+ data.tar.gz: 560b395e0616d53b6b2d3164cd9ccd34a017517256f627a098c4971b4b85a55f41f61810f735dc2c51d9afcfb1acf848574bf1b32e2185b8ec47b9afe47d946c
@@ -28,7 +28,7 @@ When you are done, you are ready to add DeviseInvitable to any of your Devise mo
28
28
 
29
29
  rails generate devise_invitable MODEL
30
30
 
31
- Replace MODEL by the class name you want to add DeviseInvitable, like User, Admin, etc. This will add the :invitable flag to your model's Devise modules. The generator will also create a migration file (if your ORM support them). Continue reading this file to understand exactly what the generator produces and how to use it.
31
+ Replace MODEL by the class name you want to add DeviseInvitable, like User, Admin, etc. This will add the :invitable flag to your model's Devise modules. The generator will also create a migration file (if your ORM supports them). Continue reading this file to understand exactly what the generator produces and how to use it.
32
32
 
33
33
  === Manual installation
34
34
 
@@ -37,6 +37,7 @@ class Devise::InvitationsController < DeviseController
37
37
 
38
38
  # PUT /resource/invitation
39
39
  def update
40
+ raw_invitation_token = update_resource_params[:invitation_token]
40
41
  self.resource = accept_resource
41
42
  invitation_accepted = resource.errors.empty?
42
43
 
@@ -53,6 +54,7 @@ class Devise::InvitationsController < DeviseController
53
54
  respond_with resource, :location => new_session_path(resource_name)
54
55
  end
55
56
  else
57
+ resource.invitation_token = raw_invitation_token
56
58
  respond_with_navigational(resource){ render :edit }
57
59
  end
58
60
  end
@@ -150,8 +150,8 @@ module Devise
150
150
  block_from_invitation? ? :invited : super
151
151
  end
152
152
 
153
- def after_password_reset
154
- super if defined?(super)
153
+ def clear_reset_password_token
154
+ super
155
155
  accept_invitation! if invited_to_sign_up?
156
156
  end
157
157
 
@@ -304,7 +304,6 @@ module Devise
304
304
 
305
305
  invitable = find_or_initialize_with_error_by(:invitation_token, invitation_token)
306
306
  invitable.errors.add(:invitation_token, :invalid) if invitable.invitation_token && invitable.persisted? && !invitable.valid_invitation?
307
- invitable.invitation_token = original_token
308
307
  invitable unless only_valid && invitable.errors.present?
309
308
  end
310
309
 
@@ -1,3 +1,3 @@
1
1
  module DeviseInvitable
2
- VERSION = '1.5.0'
2
+ VERSION = '1.5.1'
3
3
  end
@@ -26,6 +26,9 @@ class DeviseInvitable::RegistrationsControllerTest < ActionController::TestCase
26
26
 
27
27
  @invitee = User.where(:email => invitee_email).first
28
28
  assert @invitee.encrypted_password.blank?, "the password should be unset"
29
+ assert_nil @invitee.invitation_accepted_at
30
+ assert_not_nil @invitee.invitation_token
31
+ assert !@invitee.confirmed?
29
32
 
30
33
  # sign_up the invitee
31
34
  assert_difference('ActionMailer::Base.deliveries.size') do
@@ -47,8 +50,8 @@ class DeviseInvitable::RegistrationsControllerTest < ActionController::TestCase
47
50
  assert_nil @invitee.invitation_token
48
51
  assert @invitee.invited_by_id.present?
49
52
  assert @invitee.invited_by_type.present?
50
- assert !@invitee.confirmed?
51
53
  assert @invitee.confirmation_token.present?
54
+ assert !@invitee.confirmed?
52
55
  end
53
56
 
54
57
  test "not invitable resources can register" do
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.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler