File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
lib/active_record/connection_adapters/postgresql/oid
test/cases/adapters/postgresql Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def serialize(value)
3535 if value . is_a? ( ::Array )
3636 result = @pg_encoder . encode ( type_cast_array ( value , :serialize ) )
3737 if encoding = determine_encoding_of_strings ( value )
38- result . encode! ( encoding )
38+ result . force_encoding ( encoding )
3939 end
4040 result
4141 else
Original file line number Diff line number Diff line change @@ -312,9 +312,9 @@ def self.model_name; ActiveModel::Name.new(PgArray) end
312312 end
313313
314314 def test_encoding_arrays_of_utf8_strings
315- string_with_utf8 = " nový"
316- assert_equal [ string_with_utf8 ] , @type . deserialize ( @type . serialize ( [ string_with_utf8 ] ) )
317- assert_equal [ [ string_with_utf8 ] ] , @type . deserialize ( @type . serialize ( [ [ string_with_utf8 ] ] ) )
315+ arrays_of_utf8_strings = %w( nový ファイル )
316+ assert_equal arrays_of_utf8_strings , @type . deserialize ( @type . serialize ( arrays_of_utf8_strings ) )
317+ assert_equal [ arrays_of_utf8_strings ] , @type . deserialize ( @type . serialize ( [ arrays_of_utf8_strings ] ) )
318318 end
319319
320320 private
You can’t perform that action at this time.
0 commit comments