SHARE
TWEET

Untitled

a guest Dec 9th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   def create
  2.     params[:account][:officer_id] =
  3.       current_user.id if !current_user.nil? && current_user.role?(:comercial)
  4.     if Account.exists_without_info?(params[:account])
  5.       #buscar contas
  6.       account.update_attributes(params[:account])
  7.       redirect_to new_account_client_info_path(@account.id) and return
  8.     else
  9.       @account = Account.new(params[:account]).build
  10.       if @account.save
  11.         AccountMailer.registration(@account).deliver
  12.         redirect_to new_account_client_info_path(@account.id)
  13.       else
  14.         flash.now[:error] = @account.errors.full_messages
  15.         render action: "new"
  16.       end
  17.     end
  18.   end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top