Say we have this model
class Car < ActiveRecord::Base
# string name
# integer wheels
end
Executing following code
Car.where(:name => "Jeff").new #=> <Car name: "Jeff", wheels: nil>
Car.where(:wheels => [4,8]).new #=> <Car name: nil, wheels: 1>
The first case yield expected result, however the second one
does not! 1 wheel?
Car.where(:wheels => 4..8).new #=> <Car name: nil, wheels: nil>
When using a range we don't get the issue.
Test in patch
My suggestion would be to be more careful what values get passed
to the scope_for_create (relation.rb:359) method. How this should
be achieved, that I do not know.