Skip to content

Commit

Permalink
Merge pull request scambra#565 from amitree/master
Browse files Browse the repository at this point in the history
  • Loading branch information
scambra committed Jun 15, 2015
2 parents 7a7644f + 33b9b0b commit 82f450c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/devise/invitations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def edit

# PUT /resource/invitation
def update
raw_invitation_token = update_resource_params[:invitation_token]
self.resource = accept_resource
invitation_accepted = resource.errors.empty?

Expand All @@ -53,6 +54,7 @@ def update
respond_with resource, :location => new_session_path(resource_name)
end
else
resource.invitation_token = raw_invitation_token
respond_with_navigational(resource){ render :edit }
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/devise_invitable/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ def find_by_invitation_token(original_token, only_valid)

invitable = find_or_initialize_with_error_by(:invitation_token, invitation_token)
invitable.errors.add(:invitation_token, :invalid) if invitable.invitation_token && invitable.persisted? && !invitable.valid_invitation?
invitable.invitation_token = original_token
invitable unless only_valid && invitable.errors.present?
end

Expand Down

0 comments on commit 82f450c

Please sign in to comment.