source_ids 0.0.1 → 0.0.2

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: 690ff55a409b65bf6216217fc25fad77298b066e
4
- data.tar.gz: 41bb2ed30e369c21d145c69bf2d75614d6285087
3
+ metadata.gz: 4cefbe74627840ff44a086a997e80f51dc479239
4
+ data.tar.gz: e91547f4d99e8f70d8f099e0955695d07521aa3d
5
5
  SHA512:
6
- metadata.gz: da5a1820db960ea3fc6e6d2a8db2ecb5194ecf60fa5ec5017b5d9b75c0cf7d2518532f66251a0326de0511afa90b4dcd878ace2030d0fd6d7c6b871ee24c8148
7
- data.tar.gz: 9d9dd4157e9cb8b396bb86fd2fe6951ec8b7fdd9b47648d3c5d33af874706a710869563dc002c64473c5b905cad81e7ea41c18865d2e8f8281abd2015ee5f864
6
+ metadata.gz: f2a6433b0e8764ce9c71bc28f74307b4e1df5ba21559478b1b563821939e3840a93d7d94ead2665e9d4ab05578e278424d764f3584cfab2848015810d4d9012c
7
+ data.tar.gz: e38259a69f69ec6ae046f26955bc7e7dabfe2c78e42d370459e3bb18eeb2feeb73189d3647aaf030dfb56fbf3cd3b92eea288854f713c318823eddd58779c31c
@@ -1,3 +1,3 @@
1
1
  module SourceIds
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/source_ids.rb CHANGED
@@ -16,6 +16,8 @@ module SourceIds
16
16
 
17
17
  # _source_ids=
18
18
  define_method "_#{source_ids_name}=" do |ids|
19
+ ids = ids.find_all(&:present?) # care for hidden field of collection_select
20
+
19
21
  # mark destruction if not included in ids
20
22
  send(relation.name).each do |r|
21
23
  source_id = r.send(fk_in_relation)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: source_ids
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - nay3