Sha256: deb873d09b46b329ea1a2c82c3efc3d45ce8f8320cc9364ed0e579fc3cfe7a4c

Contents?: true

Size: 633 Bytes

Versions: 1

Compression:

Stored size: 633 Bytes

Contents

module BaseCrm
  class Deal < ApiClient::Resource::Base

    include BaseCrm::Resource
    include BaseCrm::Noteable
    include BaseCrm::Taskable

    namespace "deal"

    prefix    "api/v1"

    always do
      endpoint BaseCrm.config.endpoints.sales
    end

    def source
      Source.find(self.source_id)
    rescue ApiClient::Errors::NotFound
    end

    def contact
      Contact.find(self.entity_id)
    rescue ApiClient::Errors::NotFound
    end

    def contacts
      pass_headers(Contact).fetch_for_deal(self)
    end

    def noteable_type
      "Deal"
    end

    def taskable_type
      "Deal"
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
basecrm-0.0.1 lib/base_crm/deal.rb