rails/rails — pull request #11159 by alno (2013-06-28 09:11:24+00:00)
Title: Fixing encoding of non-string arrays

When array of non-string values assigned from array of strings (controller params, for example) it blows up with NoMethodError: undefined method `gsub' in quote_and_escape

It's because of quote_and_escape is called for values, which are strings before cast, while after casting it may become something other than string.

This patch fixes it, by calling quote_and_escape for values, which are strings after cast, not before.