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

@@ -1,3 +1,8 @@
1
+ == 1.3.2
2
+
3
+ * bug fix
4
+ * Fix another regression related to reset_password_sent_at (by github.com/alexdreher)
5
+
1
6
  == 1.3.1
2
7
 
3
8
  * enhancements
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise (1.3.0)
4
+ devise (1.3.1)
5
5
  bcrypt-ruby (~> 2.1.2)
6
6
  orm_adapter (~> 0.0.3)
7
7
  warden (~> 1.0.3)
@@ -42,6 +42,7 @@ module Devise
42
42
  # Checks if the reset password token sent is within the limit time.
43
43
  # We do this by calculating if the difference between today and the
44
44
  # sending date does not exceed the confirm in time configured.
45
+ # Returns true if the ressource is not responding to reset_password_sent_at at all.
45
46
  # reset_password_within is a model configuration, must always be an integer value.
46
47
  #
47
48
  # Example:
@@ -59,8 +60,8 @@ module Devise
59
60
  # reset_password_period_valid? # will always return false
60
61
  #
61
62
  def reset_password_period_valid?
62
- respond_to?(:reset_password_sent_at) && reset_password_sent_at &&
63
- reset_password_sent_at.utc >= self.class.reset_password_within.ago
63
+ return true unless respond_to?(:reset_password_sent_at)
64
+ reset_password_sent_at && reset_password_sent_at.utc >= self.class.reset_password_within.ago
64
65
  end
65
66
 
66
67
  protected
@@ -1,3 +1,3 @@
1
1
  module Devise
2
- VERSION = "1.3.1".freeze
2
+ VERSION = "1.3.2".freeze
3
3
  end
@@ -204,4 +204,11 @@ class RecoverableTest < ActiveSupport::TestCase
204
204
  user.reload
205
205
  assert_not_nil user.reset_password_token
206
206
  end
207
+
208
+ test 'should have valid period if does not respond to reset_password_sent_at' do
209
+ user = create_user
210
+ user.stubs(:respond_to?).with(:reset_password_sent_at).returns(false)
211
+ assert user.reset_password_period_valid?
212
+ end
213
+
207
214
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 1
10
- version: 1.3.1
9
+ - 2
10
+ version: 1.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Jos\xC3\xA9 Valim"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-04-19 00:00:00 +02:00
19
+ date: 2011-04-21 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency