Module: Insight::CRM::Callbacks::Account
- Defined in:
- lib/insight/crm/callbacks/account.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/insight/crm/callbacks/account.rb', line 9 def self.included(base) base.class_eval do after_create :create_crm_account end protected def create_crm_account account = CRM::Models::Account.new account.name = name account.user_id = 1 account.save self.update_attribute(:crm_id, account.id) end end |