connectwise_sdk 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f45cd5c6fe42bbaf83f0f8b7590660a0df76a5d5
4
- data.tar.gz: 68adf8018d08aa3e5e7df7170d4052414a3d23be
3
+ metadata.gz: 68ac46ac359aa92559aba1978421b651cef0c689
4
+ data.tar.gz: 2e271efa19715d2a236f0e052b8ec8e94d0c7417
5
5
  SHA512:
6
- metadata.gz: d23dba2b1452245ff468d3dd33682f31c8c10bb14ebb2b53a3d2d79f14678b3e3978ff61c1df035514ef6de0eb087aa4b7c4d55c6974775f32f6451aa62d633e
7
- data.tar.gz: 82816b240678cbe537087909880c5a5824785d3277e7c0f96af61d6cd69acf49c636bf8cf15e66ee6cacbe15f336da67ec0fa86a6206ae2293de44f6445e49e2
6
+ metadata.gz: 43098e427e3c46cbbd2a9fbc50517566f1542f5a55056b9c3626921fb5a2495dc6494326ef3608f80c926fc9694f91b3543864bab49ba77b543ac53725db92f8
7
+ data.tar.gz: 9c1465885322b7696f70da26ad0ec1074dc31f99982a19d4755ae0839428593b0ffe0f70b39493f1d7ea87f50388cf8fcc90814c1d3428cae106bc4e79a6ace8
@@ -4,7 +4,9 @@ module Connectwise
4
4
  def where(connection, *args, **attrs)
5
5
  conditions = attrs.empty? ? args.join(' ') : attrs_to_query(transform(attrs))
6
6
  resp = connection.call cw_api_name, "find_#{plural_class_name}".to_sym, {conditions: conditions}
7
- resp ? Array(remove_root_node(resp)).map {|attrs| self.new(connection, find_transform(attrs)) } : []
7
+ resp = resp.nil? ? [] : remove_root_node(resp)
8
+ resp = resp.respond_to?(:to_ary) ? resp : [resp]
9
+ resp.map {|attrs| self.new(connection, find_transform(attrs)) }
8
10
  end
9
11
 
10
12
  def find(connection, id)
@@ -1,3 +1,3 @@
1
1
  module Connectwise
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -17,4 +17,10 @@ describe Connectwise::Member do
17
17
  expect(response.count).to eq 2
18
18
  expect(response.first.class).to eq Connectwise::Member
19
19
  end
20
+
21
+ it 'finds a single member using string syntax' do
22
+ response = subject.where(conn, "MemberID='admin1'")
23
+ expect(response.count).to eq 1
24
+ expect(response.first.class).to eq Connectwise::Member
25
+ end
20
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: connectwise_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emery A. Miller