Created
December 1, 2009 18:43
-
-
Save Sporky023/246520 to your computer and use it in GitHub Desktop.
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
if @dn_email.confirmation_letter? | |
VUtility.logged_in_user_id = session[:user].id | |
@dn_email.job.update_attributes(:confirmation_letter_event_id => @event.id) | |
redirect_url = "/jobs/#{@dn_email.job_id};edit" | |
else | |
redirect_url = "/leads/#{@dn_email.lead_id};show" | |
end | |
# change 1 | |
if @dn_email.confirmation_letter? | |
@dn_email.job.logged_in_user_id = session[:user].id # DRY violation (for attr_accessor :logged_in_user_id) | |
@dn_email.job.update_attributes(:confirmation_letter_event_id => @event.id) | |
redirect_url = "/jobs/#{@dn_email.job_id};edit" | |
else | |
redirect_url = "/leads/#{@dn_email.lead_id};show" | |
end | |
# change 2 | |
if @dn_email.confirmation_letter? | |
@dn_email.job.update_by_form({:confirmation_letter_event_id => @event.id}, session[:user].id) # no longer using update_attributes | |
redirect_url = "/jobs/#{@dn_email.job_id};edit" | |
else | |
redirect_url = "/leads/#{@dn_email.lead_id};show" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment