Module: Crm::Core::Mixins::Findable::ClassMethods

Included in:
Account, Activity, Crm::Collection, Crm::Contact, Crm::Core::Mixins::Findable, Event, EventContact, Mailing, Type
Defined in:
lib/crm/core/mixins/findable.rb

Instance Method Summary collapse

Instance Method Details

#find(id) ⇒ BasicResource

Returns the requested item.

Parameters:

  • id (String)

    the ID of the item.

Returns:

Raises:



18
19
20
21
22
23
24
# File 'lib/crm/core/mixins/findable.rb', line 18

def find(id)
  if id.blank?
    raise Crm::Errors::ResourceNotFound.new(
        "Items could not be found.", [id])
  end
  new({'id' => id}).reload
end