app/models/entities/lead.rb
# Promote the lead by creating contact and optional opportunity. Upon
# successful promotion Lead status gets set to :converted.
#----------------------------------------------------------------------------
Promote the lead by creating contact and optional opportunity. Upon
successful promotion Lead status gets set to :converted.
Promote the lead by creating contact and optional opportunity . Upon successful promotion Lead status gets set to : converted .
def promote(params)
    account     = Account.create_or_select_for(self, params[:account])
    opportunity = Opportunity.create_for(self, account, params[:opportunity])
    contact     = Contact.create_for(self, account, opportunity, params)
    pass = params[:custom_password] || "password"
    @@icecondos_connection.post do |req|
      req.url "#{APP_CONFIG[:icecondos_url]}/users/user_from_crm", new_user: { email: self.email, first_name: self.first_name, last_name: self.last_name, phone_number: self.phone, password: pass, password_confirmation: pass}, token: APP_CONFIG[:crm_call_token]
    end
    [account, opportunity, contact]
  end
def promote ( params ) account = Account . create_or_select_for ( self , params [ :account ] ) opportunity = Opportunity . create_for ( self , account , params [ :opportunity ] ) contact = Contact . create_for ( self , account , opportunity , params ) pass = params [ :custom_password ] || "password" @@icecondos_connection . post do | req | req . url "#{APP_CONFIG[:icecondos_url]}/users/user_from_crm" , new_user : { email : self . email , first_name : self . first_name , last_name : self . last_name , phone_number : self . phone , password : pass , password_confirmation : pass } , token : APP_CONFIG [ :crm_call_token ] end [ account , opportunity , contact ] end
Promote the lead by creating contact and optional opportunity.
Promote the lead by creating contact and optional opportunity .
params