loyal_devise 2.2.5 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,8 +24,8 @@ module Devise
24
24
  #
25
25
  # == Examples
26
26
  #
27
- # User.find(1).confirm! # returns true unless it's already confirmed
28
- # User.find(1).confirmed? # true/false
27
+ # User.find(1).email_confirm! # returns true unless it's already confirmed
28
+ # User.find(1).email_confirmed? # true/false
29
29
  # User.find(1).send_confirmation_instructions # manually send instructions
30
30
  #
31
31
  module Confirmable
@@ -33,7 +33,7 @@ module Devise
33
33
  include ActionView::Helpers::DateHelper
34
34
 
35
35
  included do
36
- before_create :generate_confirmation_token, :if => :confirmation_required?
36
+ before_create :generate_confirmation_token, :if => :email_confirmation_required?
37
37
  after_create :send_on_create_confirmation_instructions, :if => :send_confirmation_notification?
38
38
  before_update :postpone_email_change_until_confirmation, :if => :postpone_email_change?
39
39
  after_update :send_confirmation_instructions, :if => :reconfirmation_required?
@@ -55,7 +55,7 @@ module Devise
55
55
  # Confirm a user by setting it's confirmed_at to actual time. If the user
56
56
  # is already confirmed, add an error to email field. If the user is invalid
57
57
  # add errors
58
- def confirm!
58
+ def email_confirm!
59
59
  pending_any_confirmation do
60
60
  if confirmation_period_expired?
61
61
  self.errors.add(:email, :confirmation_period_expired,
@@ -80,7 +80,7 @@ module Devise
80
80
  end
81
81
 
82
82
  # Verifies whether a user is confirmed or not
83
- def confirmed?
83
+ def email_confirmed?
84
84
  !!confirmed_at
85
85
  end
86
86
 
@@ -112,12 +112,12 @@ module Devise
112
112
  # is already confirmed, it should never be blocked. Otherwise we need to
113
113
  # calculate if the confirm time has not expired for this user.
114
114
  def active_for_authentication?
115
- super && (!confirmation_required? || confirmed? || confirmation_period_valid?)
115
+ super && (!email_confirmation_required? || email_confirmed? || confirmation_period_valid?)
116
116
  end
117
117
 
118
118
  # The message to be shown if the account is inactive.
119
119
  def inactive_message
120
- !confirmed? ? :unconfirmed : super
120
+ !email_confirmed? ? :unconfirmed : super
121
121
  end
122
122
 
123
123
  # If you don't want confirmation to be sent on create, neither a code
@@ -148,8 +148,8 @@ module Devise
148
148
  end
149
149
 
150
150
  # Callback to overwrite if confirmation is required or not.
151
- def confirmation_required?
152
- !confirmed?
151
+ def email_confirmation_required?
152
+ !email_confirmed?
153
153
  end
154
154
 
155
155
  # Checks if the confirmation for the user is within the limit time.
@@ -196,7 +196,7 @@ module Devise
196
196
 
197
197
  # Checks whether the record requires any confirmation.
198
198
  def pending_any_confirmation
199
- if (!confirmed? || pending_reconfirmation?)
199
+ if (!email_confirmed? || pending_reconfirmation?)
200
200
  yield
201
201
  else
202
202
  self.errors.add(:email, :already_confirmed)
@@ -217,7 +217,7 @@ module Devise
217
217
 
218
218
  def after_password_reset
219
219
  super
220
- confirm! unless confirmed?
220
+ email_confirm! unless email_confirmed?
221
221
  end
222
222
 
223
223
  def postpone_email_change_until_confirmation
@@ -237,7 +237,7 @@ module Devise
237
237
  end
238
238
 
239
239
  def send_confirmation_notification?
240
- confirmation_required? && !@skip_confirmation_notification
240
+ email_confirmation_required? && !@skip_confirmation_notification
241
241
  end
242
242
 
243
243
  module ClassMethods
@@ -260,7 +260,7 @@ module Devise
260
260
  # Options must have the confirmation_token
261
261
  def confirm_by_token(confirmation_token)
262
262
  confirmable = find_or_initialize_with_error_by(:confirmation_token, confirmation_token)
263
- confirmable.confirm! if confirmable.persisted?
263
+ confirmable.email_confirm! if confirmable.persisted?
264
264
  confirmable
265
265
  end
266
266
 
@@ -1,3 +1,3 @@
1
1
  module Devise
2
- VERSION = "2.2.5".freeze
2
+ VERSION = "2.2.6".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loyal_devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-08-09 00:00:00.000000000 Z
13
+ date: 2013-09-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: loyal_warden
@@ -212,7 +212,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  segments:
214
214
  - 0
215
- hash: -3598321413958373019
215
+ hash: 126468515477557902
216
216
  required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  none: false
218
218
  requirements:
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  version: '0'
222
222
  segments:
223
223
  - 0
224
- hash: -3598321413958373019
224
+ hash: 126468515477557902
225
225
  requirements: []
226
226
  rubyforge_project: loyal_devise
227
227
  rubygems_version: 1.8.25