public
Fork of insoshi/insoshi
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/toim/insoshi.git
Cleaned up email verifications
This closes ticket #56.
Michael Hartl (author)
Thu May 08 09:35:45 -0700 2008
commit  1fb5cb875833aa1a7c41179a37f4cd8897c182a2
tree    f41cc102a14e3df7cd600500b3c9fd6467e60736
parent  ca931746525b469a2384bb1414adc6a0186ab9bc
...
42
43
44
 
45
46
47
48
49
50
51
 
52
53
54
...
42
43
44
45
46
47
48
 
 
 
 
49
50
51
52
0
@@ -42,13 +42,11 @@ class PeopleController < ApplicationController
0
     cookies.delete :auth_token
0
     @person = Person.new(params[:person])
0
     respond_to do |format|
0
+ @person.deactivated = true if global_prefs.email_verifications?
0
       if @person.save
0
         self.current_person = @person
0
         if global_prefs.email_verifications?
0
- # TODO: move some of this into models.
0
- @person.deactivated = true; @person.save!
0
- @verification = EmailVerification.create(:person => @person)
0
- @person.email_verifications << @verification
0
+ @person.email_verifications.create
0
           flash[:notice] = %(Thanks for signing up! A verification email has
0
                              been sent to #{@person.email}.)
0
           format.html { redirect_to(home_url) }
...
116
117
118
119
 
120
121
122
...
125
126
127
128
 
129
130
131
...
116
117
118
 
119
120
121
122
...
125
126
127
 
128
129
130
131
0
@@ -116,7 +116,7 @@ describe PeopleController do
0
         it "should verify a person" do
0
           person = create_person
0
           person.should be_deactivated
0
- verification = assigns(:verification)
0
+ verification = assigns(:person).email_verifications.last
0
           get :verify, :id => verification.code
0
           person.reload.should be_active
0
           response.should redirect_to(person_path(person))
0
@@ -125,7 +125,7 @@ describe PeopleController do
0
         it "should verify a person even if they're logged in" do
0
           person = create_person
0
           login_as(person)
0
- verification = assigns(:verification)
0
+ verification = person.email_verifications.last
0
           get :verify, :id => verification.code
0
           person.reload.should be_active
0
           response.should redirect_to(person_path(person))

Comments

    No one has commented yet.