
Untitled
By: a guest on
May 31st, 2012 | syntax:
None | size: 0.89 KB | hits: 13 | expires: Never
# This needs some love real bad.
def update_business_user
user = MarketplaceUser.new(:login => params[:login],
:password => params[:password],
:password_confirmation => params[:password_confirmation],
:advertiser_source_id => params[:advertiser_source_id])
existing_user = MarketplaceUser.first(:advertiser_source_id => user.advertiser_source_id)
# wtf is this retardation doing!?? we are updating not creating
if existing_user
existing_user.login = user.login
existing_user.password = user.password
existing_user.password_confirmation = user.password_confirmation
user = existing_user
end
user.authentication_level = :business
# ugly ass hack to make this obj dirty
# refactor me at some point
user.make_dirty!
user.save
redirect_to("/customer_admin/#{user.advertiser_source_id}/account")
end