-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add resend_x_instructions! method * make doc example different * Bump to 1.0.2 * Bump to 1.1.0
- Loading branch information
1 parent
a7b2206
commit 50efc15
Showing
13 changed files
with
1,256 additions
and
22 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,20 @@ def send_instructions!(model, key) | |
model.save(validate: false) | ||
end | ||
|
||
# Calls set_token! and send_instructions! to generate a new token and send instructions again (accepts a block, such as a mailer method, for sending instructions).<br />Note, any previously generated token for the user will be invalid. | ||
# @example Resend Reset Instructions | ||
# user.resend_reset_instruction! { user.send_email } => | ||
# <User id: 205, name: "John Smith", email: "[email protected]", reset_token: "4ZcHkSJ8kXrV4wl", reset_created_at: 2017-04-25 16:21:54", reset_sent_at: "2017-04-25 16:22:42", reset_completed_at: nil> | ||
# @param [Object] model the tokenable model instance | ||
# @param [String, Symbol] key the tokenable action | ||
# @param [Integer] token_length the length of the generated token, method will use configuration token_length if not provided otherwise | ||
# @raise [NotTokenableError] if the provided Class does not have the correct tokenable column | ||
# @return [Object] tokenable model instance | ||
def resend_instructions!(model, key, token_length = nil) | ||
set_token!(model, key, token_length) | ||
send_instructions!(model, key) | ||
end | ||
|
||
# Provides the status of the tokenable action, whether the action has been completed, the token has been sent, the token is expired, or the token has only been created | ||
# @param [Object] model the tokenable model instance | ||
# @param [String, Symbol] key the tokenable action | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module TokenMaster | ||
# Current version of TokenMaster | ||
VERSION = '1.0.1'.freeze | ||
VERSION = '1.1.0'.freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FactoryGirl.define do | ||
FactoryBot.define do | ||
factory :user do | ||
sequence(:email) { |n| "user_#{n}@example.com"} | ||
password "password" | ||
password_confirmation "password" | ||
password 'password' | ||
password_confirmation 'password' | ||
name { Faker::Name.name } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
RSpec.configure do |config| | ||
config.include FactoryBot::Syntax::Methods | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters