devise 3.5.7 → 3.5.8

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

Potentially problematic release.


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

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cdd92a945c0610afa574e7ae8c2db8b6791b6fbf
4
- data.tar.gz: 01f1cc5980cd635da0d87c42224e0e20e3bbd714
3
+ metadata.gz: cc84cc1ced722c875939d859ae9be0a34284acd0
4
+ data.tar.gz: 6dc021393b11cb9d8dae09d25169183c2595df5c
5
5
  SHA512:
6
- metadata.gz: b3283d703d49ecabec08f82da2e19ddd7998cc551f7505bd87a72a9b32111eb093d1185446ae880fe2ad5ca6720d450de2bf954fcb6fb94eda8ef3efc2723da6
7
- data.tar.gz: 6fb78ddd82071e22c7d2686a9a92f950fedc3f6b57b2fd2edadd048a878840d496a633be2f5aca9256657cce04e342993b147d3c5fac96f5ddbf18ed623b405f
6
+ metadata.gz: 0ecba37571b438f72d64c7141b08d6b0153c8e05ac955b290ea429f9f303010bf237d0efca9fd87fc8b4db930134118df016c3c4aac3471c0dc7196095f57627
7
+ data.tar.gz: 179a79cf22534e1f0bbedb3eef1a49e3c7e9fbeaed6c4464726234f8ef095ca347d0700f9b3deea7a7256c2ae55146824ccb0f78d36f30284a2e9eaad02d918b
@@ -1,5 +1,10 @@
1
1
  ### Unreleased
2
2
 
3
+ ### 3.5.8 - 2016-04-25
4
+
5
+ * bug fixes
6
+ * Fix the e-mail confirmation instructions send when a user updates the email address from nil
7
+
3
8
  ### 3.5.7 - 2016-04-18
4
9
 
5
10
  * bug fixes
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise (3.5.7)
4
+ devise (3.5.8)
5
5
  bcrypt (~> 3.0)
6
6
  orm_adapter (~> 0.1)
7
7
  railties (>= 3.2.6, < 5)
@@ -170,6 +170,7 @@ module Devise
170
170
  # in models to map to a nice sign up e-mail.
171
171
  def send_on_create_confirmation_instructions
172
172
  send_confirmation_instructions
173
+ skip_reconfirmation!
173
174
  end
174
175
 
175
176
  # Callback to overwrite if confirmation is required or not.
@@ -254,13 +255,13 @@ module Devise
254
255
  end
255
256
 
256
257
  def postpone_email_change?
257
- postpone = self.class.reconfirmable && email_changed? && email_was.present? && !@bypass_confirmation_postpone && self.email.present?
258
+ postpone = self.class.reconfirmable && email_changed? && !@bypass_confirmation_postpone && self.email.present?
258
259
  @bypass_confirmation_postpone = false
259
260
  postpone
260
261
  end
261
262
 
262
263
  def reconfirmation_required?
263
- self.class.reconfirmable && @reconfirmation_required && self.email.present?
264
+ self.class.reconfirmable && @reconfirmation_required && (self.email.present? || self.unconfirmed_email.present?)
264
265
  end
265
266
 
266
267
  def send_confirmation_notification?
@@ -1,3 +1,3 @@
1
1
  module Devise
2
- VERSION = "3.5.7".freeze
2
+ VERSION = "3.5.8".freeze
3
3
  end
@@ -114,7 +114,7 @@ class ConfirmableTest < ActiveSupport::TestCase
114
114
 
115
115
  assert_email_not_sent do
116
116
  user.save!
117
- assert !user.confirmed?
117
+ assert_not user.confirmed?
118
118
  end
119
119
  end
120
120
 
@@ -401,6 +401,14 @@ class ReconfirmableTest < ActiveSupport::TestCase
401
401
  assert_match "new_test@example.com", ActionMailer::Base.deliveries.last.body.encoded
402
402
  end
403
403
 
404
+ test 'should send confirmation instructions by email after changing email from nil' do
405
+ admin = create_admin(email: nil)
406
+ assert_email_sent "new_test@example.com" do
407
+ assert admin.update_attributes(email: 'new_test@example.com')
408
+ end
409
+ assert_match "new_test@example.com", ActionMailer::Base.deliveries.last.body.encoded
410
+ end
411
+
404
412
  test 'should not send confirmation by email after changing password' do
405
413
  admin = create_admin
406
414
  assert admin.confirm
@@ -488,8 +496,8 @@ class ReconfirmableTest < ActiveSupport::TestCase
488
496
  end
489
497
 
490
498
  test 'should not require reconfirmation after creating a record' do
491
- user = create_admin
492
- assert !user.pending_reconfirmation?
499
+ admin = create_admin
500
+ assert !admin.pending_reconfirmation?
493
501
  end
494
502
 
495
503
  test 'should not require reconfirmation after creating a record with #save called in callback' do
@@ -497,7 +505,7 @@ class ReconfirmableTest < ActiveSupport::TestCase
497
505
  after_create :save
498
506
  end
499
507
 
500
- user = Admin::WithSaveInCallback.create(valid_attributes.except(:username))
501
- assert !user.pending_reconfirmation?
508
+ admin = Admin::WithSaveInCallback.create(valid_attributes.except(:username))
509
+ assert !admin.pending_reconfirmation?
502
510
  end
503
511
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.7
4
+ version: 3.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Valim
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-18 00:00:00.000000000 Z
12
+ date: 2016-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: warden