capsule_crm 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c64b18ad5ae22dbcaf9ace0fdd893299911b925
4
- data.tar.gz: f684b6a5d8f79d5fb6e5ed275daacd5243621240
3
+ metadata.gz: 8e7405598f0066a5e3cd37b3ec6f2bd8439a6dd6
4
+ data.tar.gz: 40795732dd03c2421f124210a156566bc83b7577
5
5
  SHA512:
6
- metadata.gz: 19d1fbd6fa1f9a4f024a823cf5262ff7118cedefee045c376e2bfa9a7fffb5578b770e72a7a45cc0b90635244b394780aa59dd1057796f4290848f688459a269
7
- data.tar.gz: cb636752bac73d982aab671b6737da532205510e46d902faef671250b761e9481447c8f61c384e5d2703f5aa1c856c2b1358c77648be113e2de71ee2702c019a
6
+ metadata.gz: 48cd1bd25e778753423acff294711e295a1c72a0aae39f2ae4dff4545cc62896760bd41a405c78ce7365f71c97b65de409ca737e8c9322fbaa970e4489eeecc4
7
+ data.tar.gz: 122894fd877dd1c63b9e6d78d74d4a152a70bdde22dc4f792290a87197419c4e1ed08b32bee772e37035c065a3f3229e03df0e00376e742b130f71efdfab916b
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  rvm:
3
4
  - 2.1.0
4
5
  - 2.0.0
@@ -80,8 +80,10 @@ module CapsuleCRM
80
80
  def collection_to_array(collection)
81
81
  if collection.is_a?(Hash)
82
82
  Array(target_klass.new(collection[collection.keys.first]))
83
- else
83
+ elsif collection.is_a?(Array)
84
84
  collection
85
+ else
86
+ Array(collection)
85
87
  end
86
88
  end
87
89
 
@@ -1,3 +1,3 @@
1
1
  module CapsuleCrm
2
- VERSION = '1.5.2'
2
+ VERSION = '1.5.3'
3
3
  end
@@ -49,9 +49,23 @@ describe CapsuleCRM::Associations::HasManyAssociation do
49
49
  end
50
50
  end
51
51
 
52
- context 'when a collection is not supplied' do
52
+ context 'when a collection is supplied' do
53
53
  let(:name) { Faker::Lorem.word }
54
54
 
55
+ context 'when the collection is an object' do
56
+ let(:collection) { CapsuleCRM::SomeClass.new }
57
+
58
+ subject { association.proxy(parent, collection) }
59
+
60
+ it 'should return an array' do
61
+ expect(subject).to be_a(Array)
62
+ end
63
+
64
+ it 'should contain the object passed to the collection' do
65
+ expect(subject).to include(collection)
66
+ end
67
+ end
68
+
55
69
  context 'when the collection is a hash' do
56
70
  let(:collection) do
57
71
  { some_class: { name: name } }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capsule_crm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Beedle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2014-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -410,7 +410,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
410
  version: '0'
411
411
  requirements: []
412
412
  rubyforge_project:
413
- rubygems_version: 2.2.0
413
+ rubygems_version: 2.2.2
414
414
  signing_key:
415
415
  specification_version: 4
416
416
  summary: Gem to communicate with CapsuleCRM
@@ -499,4 +499,3 @@ test_files:
499
499
  - spec/support/shared_examples/persistable.rb
500
500
  - spec/support/single_person.json
501
501
  - spec/support/task.json
502
- has_rdoc: