aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/sqlite3/quoting_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-28 14:44:49 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-28 14:50:30 -0600
commitb404613c977a5cc31c6748723e903fa5a0709c3b (patch)
tree6b64495c4717e92317c81c26f989686e21b88122 /activerecord/test/cases/adapters/sqlite3/quoting_test.rb
parentb44174f8c8f3b9b8040955f981d30e64558f0044 (diff)
downloadrails-b404613c977a5cc31c6748723e903fa5a0709c3b.tar.gz
rails-b404613c977a5cc31c6748723e903fa5a0709c3b.tar.bz2
rails-b404613c977a5cc31c6748723e903fa5a0709c3b.zip
Always pass a column with a type object to quote
The only case where we got a column that was not `nil`, but did not respond to `cast_type` was when type casting the default value during schema creation. We can look up the cast type, and add that object to the column definition. Will allow us to consistently rely on the type objects for type casting in all directions.
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3/quoting_test.rb')
-rw-r--r--activerecord/test/cases/adapters/sqlite3/quoting_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb
index 8c9a051eea..3bd53aa278 100644
--- a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb
+++ b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb
@@ -15,10 +15,10 @@ module ActiveRecord
def test_type_cast_binary_encoding_without_logger
@conn.extend(Module.new { def logger; end })
- cast_type = Type::String.new
+ column = Column.new(nil, nil, Type::String.new)
binary = SecureRandom.hex
expected = binary.dup.encode!(Encoding::UTF_8)
- assert_equal expected, @conn.type_cast(binary, cast_type)
+ assert_equal expected, @conn.type_cast(binary, column)
end
def test_type_cast_symbol