This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

You can now retry a signup

Fixed a bug
  • Loading branch information...
1 parent 075ee44 commit 69b53dc83b7595d7efaa6686165fb5bb2dda3d86 @cbetta committed Aug 6, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 app/controllers/authorisations_controller.rb
@@ -27,6 +27,9 @@ def test
# POST /authorisations
# POST /authorisations.json
def create
+ if authorisation = Authorisation.where("phone_number = ? AND confirmed IS NULL", params[:authorisation][:phone_number].gsub(/[^0-9]/, "")).first
+ authorisation.destroy
+ end
@authorisation = Authorisation.new(params[:authorisation])
respond_to do |format|
@@ -48,7 +51,7 @@ def update
if @authorisation.confirmation_code == params[:authorisation][:code].upcase
@authorisation.confirmed = true
@authorisation.save
- Messenger.send(self.phone_number, "You are now setup as a 999now responder. Text STOP at any time to unsubscribe.", true)
+ Messenger.send(@authorisation.phone_number, "You are now setup as a 999now responder. Text STOP at any time to unsubscribe.", true)
format.html { redirect_to root_url, notice: 'You are now setup as a <strong>999now</strong> responder.' }
format.json { head :ok }

0 comments on commit 69b53dc

Please sign in to comment.