devise 4.0.0 → 4.0.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 might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 693c6038f27cc54c1fe16fd9cd36248963838e5d
4
- data.tar.gz: ac7de821309c5c7e7b945e1fbda81cd7a2dcc06b
3
+ metadata.gz: 79522f86bce86d9799bdcb6423874fa3c97ebe4d
4
+ data.tar.gz: 345b7fddfccde780d47a4243cca4185e9cc56eb5
5
5
  SHA512:
6
- metadata.gz: ce83c62cbeeb436413cde1df89d40eb95c27739f4536c295fa946df980f5c5775c7e6e50c06d29f2d047f9a4a4a78d8fca2fe93f100806eeca2c1c05eb24a584
7
- data.tar.gz: 29e5e431d5dfde54ebdcbd6f80f357161648bb2a51a1492e98560646c24d9cac5ee427089d4ff995698e61aa553510d303a64391b58e9492f64b3cb76c9dec75
6
+ metadata.gz: 8034c10fd7ba604728cc7d420a7eafe2f1e403a871aacdded4b3f9dc4517053fe7ddfd342db52735101ae66fabfc84df29f556b2e8152fcd63ba552a3eba5e4e
7
+ data.tar.gz: 66e6a2fb1cb1f939f11156ea92a0b40c5e90718b2e93a75d7948b700a41093dcabddaf7ef8ff040bb3efd30b4bd46fe0e4e0c3b913bcccd1ca06a5aafb002c23
@@ -1,5 +1,13 @@
1
1
  ### Unreleased
2
2
 
3
+ ### 4.0.1 - 2016-04-25
4
+
5
+ * bug fixes
6
+ * Fix the e-mail confirmation instructions send when a user updates the email
7
+ address from nil. (by @lmduc)
8
+ * Remove unnecessary `attribute_will_change!` call. (by @cadejscroggins)
9
+ * Consistent `permit!` check. (by @ulissesalmeida)
10
+
3
11
  ### 4.0.0 - 2016-04-18
4
12
 
5
13
  * bug fixes
data/Gemfile CHANGED
@@ -25,5 +25,5 @@ platforms :ruby do
25
25
  end
26
26
 
27
27
  group :mongoid do
28
- gem "mongoid", "~> 4.0"
28
+ gem "mongoid", "~> 5.0"
29
29
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise (4.0.0)
4
+ devise (4.0.1)
5
5
  bcrypt (~> 3.0)
6
6
  orm_adapter (~> 0.1)
7
7
  railties (>= 4.1.0, < 5.1)
@@ -48,10 +48,9 @@ GEM
48
48
  tzinfo (~> 1.1)
49
49
  arel (6.0.3)
50
50
  bcrypt (3.1.11)
51
- bson (3.2.6)
51
+ bson (4.0.0)
52
52
  builder (3.2.2)
53
53
  concurrent-ruby (1.0.1)
54
- connection_pool (2.2.0)
55
54
  erubis (2.7.0)
56
55
  faraday (0.9.2)
57
56
  multipart-post (>= 1.2, < 3)
@@ -71,15 +70,13 @@ GEM
71
70
  minitest (5.8.4)
72
71
  mocha (1.1.0)
73
72
  metaclass (~> 0.0.1)
74
- mongoid (4.0.2)
73
+ mongo (2.2.0)
74
+ bson (~> 4.0)
75
+ mongoid (5.0.1)
75
76
  activemodel (~> 4.0)
76
- moped (~> 2.0.0)
77
+ mongo (~> 2.1)
77
78
  origin (~> 2.1)
78
79
  tzinfo (>= 0.3.37)
79
- moped (2.0.7)
80
- bson (~> 3.0)
81
- connection_pool (~> 2.0)
82
- optionable (~> 0.2.0)
83
80
  multi_json (1.11.2)
84
81
  multi_xml (0.5.5)
85
82
  multipart-post (2.0.0)
@@ -102,7 +99,6 @@ GEM
102
99
  omniauth-openid (1.0.1)
103
100
  omniauth (~> 1.0)
104
101
  rack-openid (~> 1.3.1)
105
- optionable (0.2.0)
106
102
  origin (2.2.0)
107
103
  orm_adapter (0.5.0)
108
104
  rack (1.6.4)
@@ -169,7 +165,7 @@ DEPENDENCIES
169
165
  devise!
170
166
  jruby-openssl
171
167
  mocha (~> 1.1)
172
- mongoid (~> 4.0)
168
+ mongoid (~> 5.0)
173
169
  omniauth (~> 1.3)
174
170
  omniauth-facebook
175
171
  omniauth-oauth2 (~> 1.4)
@@ -253,7 +253,7 @@ module Devise
253
253
 
254
254
  # Find or initialize a record with group of attributes based on a list of required attributes.
255
255
  def find_or_initialize_with_errors(required_attributes, attributes, error=:invalid) #:nodoc:
256
- attributes = if attributes.respond_to? :permit
256
+ attributes = if attributes.respond_to? :permit!
257
257
  attributes.slice(*required_attributes).permit!.to_h.with_indifferent_access
258
258
  else
259
259
  attributes.with_indifferent_access.slice(*required_attributes)
@@ -169,6 +169,7 @@ module Devise
169
169
  # in models to map to a nice sign up e-mail.
170
170
  def send_on_create_confirmation_instructions
171
171
  send_confirmation_instructions
172
+ skip_reconfirmation!
172
173
  end
173
174
 
174
175
  # Callback to overwrite if confirmation is required or not.
@@ -253,13 +254,13 @@ module Devise
253
254
  end
254
255
 
255
256
  def postpone_email_change?
256
- postpone = self.class.reconfirmable && email_changed? && email_was.present? && !@bypass_confirmation_postpone && self.email.present?
257
+ postpone = self.class.reconfirmable && email_changed? && !@bypass_confirmation_postpone && self.email.present?
257
258
  @bypass_confirmation_postpone = false
258
259
  postpone
259
260
  end
260
261
 
261
262
  def reconfirmation_required?
262
- self.class.reconfirmable && @reconfirmation_required && self.email.present?
263
+ self.class.reconfirmable && @reconfirmation_required && (self.email.present? || self.unconfirmed_email.present?)
263
264
  end
264
265
 
265
266
  def send_confirmation_notification?
@@ -41,7 +41,6 @@ module Devise
41
41
  # For legacy reasons, we use `encrypted_password` to store
42
42
  # the hashed password.
43
43
  def password=(new_password)
44
- attribute_will_change! 'password'
45
44
  @password = new_password
46
45
  self.encrypted_password = password_digest(@password) if @password.present?
47
46
  end
@@ -1,3 +1,3 @@
1
1
  module Devise
2
- VERSION = "4.0.0".freeze
2
+ VERSION = "4.0.1".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
@@ -1,5 +1,5 @@
1
1
  test:
2
- sessions:
2
+ <%= Mongoid::VERSION.to_i > 4 ? 'clients' : 'sessions' %>:
3
3
  default:
4
4
  database: devise-test-suite
5
5
  hosts:
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: 4.0.0
4
+ version: 4.0.1
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