Method: Pipekit::Repository#where
- Defined in:
- lib/pipekit/repository.rb
#where(options, raise_error = false) ⇒ Object
Public: Get all records from Pipedrive by one of the record’s fields.
options - A Hash with one key-value pair. Key is a field name and values is a field value.
Examples
where(name: "John Doe")
where(github_username: "pipedriver")
where(id: 123)
Returns array of Hashes.
23 24 25 26 27 28 |
# File 'lib/pipekit/repository.rb', line 23 def where(, raise_error = false) send("get_by_#{options.keys.first}", .values.first) rescue ResourceNotFoundError => error raise error if raise_error [] end |