Bugs with Multiselect.js

Amos, Ohad,

I found 2 bugs in our implementation of Multiselect.js

  1. When all items are unselected, nil is passed instead of [], which means that nothing is unselected

example.
params[:location][:domain_ids] = nil —> nothing happens
params[:location][:domain_ids] = [] —> all rows are deleted which is what should happen

  1. Disabled selections are not passed to array of _ids, so they are incorrectly deleted.

example - selected items

option1
option2
option3(disabled)
option4(disabled)
option5(disabled)

after submitted - disabled items are deleted from list.

option1
option2

Regards,

Joseph