Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Don't convert empty arrays to nils when deep munging params #16924
This commit tweaks the behaviour of
Previously, when an empty array was passed as an argument to a
Now (example using Rails 4.1.5 and Postgres 9.2.8), ActiveRecord generates a query like:
which never returns any rows.
This new behaviour makes it possible to change the behaviour of
Conveniently, this would fix rails/strong_parameters#192 as well.
I realise it wouldn't be appropriate to target this change at 4.2 this late in the day, but it seems like it would be a nice improvement for 4.3.
This change looks fine to me, however I think we should also revisit the munging of
It was initially a suprising API which when combined with .blank? ended up doing crazy things, but perhaps we can simply document that behaviour now and move on?