rails/rails — pull request #18282 by waratuman (2015-01-01 06:10:34+00:00)
Title: `update_columns` should still cast_type_from_user.

When setting attributes via update_column the model should still
attributes should still reflect the casted_value from the database adapter, not
what was set directly. For example:

# create_table :pg_arrays do |t|
# t.string :tags, array: true
# end
class PgArray < ActiveRecord::Base
self.table_name = 'pg_arrays'
end

x = PgArray.create(tags: [1,2,3])
# PostgreSQL array syntax should be parsed
x.update_columns(tags: '{1,2,3,4}')

Previously `x.tags` would return a string `"{1,2,3,4}"` because that is
what was directly set. Instead it should return the parsed array:

x.tags # => [1,2,3,4]