Skip to content

Commit 64e484c

Browse files
authored
Merge pull request #2012 from koic/deprecate_passing_column_to_type_cast
Deprecate passing a column to `type_cast`
2 parents 125c064 + 38f5b97 commit 64e484c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/active_record/oracle_enhanced/type/national_character_string_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ class ::TestItem < ActiveRecord::Base
3535
columns = @conn.columns("test_items")
3636
%w(nchar_column nvarchar2_column char_column varchar2_column).each do |col|
3737
column = columns.detect { |c| c.name == col }
38-
value = @conn.type_cast_from_column(column, "abc")
38+
type = @conn.lookup_cast_type_from_column(column)
39+
value = type.serialize("abc")
3940
expect(@conn.quote(value)).to eq(column.sql_type[0, 1] == "N" ? "N'abc'" : "'abc'")
40-
nilvalue = @conn.type_cast_from_column(column, nil)
41+
type = @conn.lookup_cast_type_from_column(column)
42+
nilvalue = type.serialize(nil)
4143
expect(@conn.quote(nilvalue)).to eq("NULL")
4244
end
4345
end

0 commit comments

Comments
 (0)