提交 be5527b8 编写于 作者: Y Yves Senn

`connection.type_to_sql` returns a `String` for unmapped types.

Closes #13146.

This fixes an error when using:

```
change_colum :table, :column, :bigint, array: true
```
上级 7c20a8b5
* `type_to_sql` returns a `String` for unmapped columns. This fixes an error
when using unmapped array types in PG
Example:
change_colum :table, :column, :bigint, array: true
Fixes #13146.
*Jens Fahnenbruck*, *Yves Senn*
* Fix `QueryCache` to work with nested blocks, so that it will only clear the existing cache
after leaving the outer block instead of clearing it right after the inner block is finished.
......
......@@ -690,7 +690,7 @@ def type_to_sql(type, limit = nil, precision = nil, scale = nil) #:nodoc:
column_type_sql
else
type
type.to_s
end
end
......
......@@ -178,6 +178,10 @@ def test_select_all_always_return_activerecord_result
result = @connection.select_all "SELECT * FROM posts"
assert result.is_a?(ActiveRecord::Result)
end
test "type_to_sql returns a String for unmapped types" do
assert_equal "special_db_type", @connection.type_to_sql(:special_db_type)
end
end
class AdapterTestWithoutTransaction < ActiveRecord::TestCase
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册