active_record-json_associations 0.6.4 → 0.6.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: d1e06abf3a2973786ce241dcfba6b3f47860b249
4
- data.tar.gz: 7a5fa9825c49a9a182f69ca10077a41bc1f3e1b7
3
+ metadata.gz: 4348ec4c6f40c8428b39e5939de016e8c8f73e8c
4
+ data.tar.gz: 82e9d510c5c6aac1c8829af42b97f26d8a9c6cc6
5
5
  SHA512:
6
- metadata.gz: 192c325a0f407628cf644b0decaf828fa8a1a8c27126860044b132e0f8471435af9e112227d8aa410480e4778dddf2d9a9d28288c93335fade93430a60b0876f
7
- data.tar.gz: e56949386bd95552e91ce09c40a49522a5bde63ff07e878b24c9512a07b96579ee047e30b07be7141efc3102899ed403f3f9a4365ffe6b59e7f1af4e3a30e287
6
+ metadata.gz: 0b7204f1470b38fae8ea2ee590da515d577942739cd837628401eeed5024f9022ab71df09ba3c57af12ca3b36b9e02357fe3507c83e3d001185a46807d6255a4
7
+ data.tar.gz: 2729ef38c50d066eab6d0b7841809df80d6ed727ae5286bb9d206fc80c2f0a2c0ce35505b8b2e3e4647d3b181401277757f4ce9dbf09cbdbc50f89f269c3473c
@@ -20,7 +20,7 @@ module ActiveRecord
20
20
  end
21
21
 
22
22
  define_method one_ids_equals do |ids|
23
- super Array(ids).map(&:to_i)
23
+ super Array(ids).select(&:present?).map(&:to_i)
24
24
  end
25
25
 
26
26
  define_method many do
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module JsonAssociations
3
- VERSION = "0.6.4"
3
+ VERSION = "0.6.5"
4
4
  end
5
5
  end
@@ -55,6 +55,11 @@ describe ActiveRecord::JsonAssociations do
55
55
  subject.child_ids = ["1",2,"3"]
56
56
  expect(subject.child_ids).to eq [1,2,3]
57
57
  end
58
+
59
+ it "ignores empty strings" do
60
+ subject.child_ids = ["","1","2","3"]
61
+ expect(subject.child_ids).to eq [1,2,3]
62
+ end
58
63
  end
59
64
 
60
65
  describe "#children" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record-json_associations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord