aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-11-17 14:56:38 -0500
committerGitHub <noreply@github.com>2016-11-17 14:56:38 -0500
commit4331ee8390908e52e56cf62b2759a152cddfe1b2 (patch)
tree8969fab99837eeb8a29660d3d4cfc785daef4d99 /activerecord/lib/active_record
parent07af54d43cba30be7c206c5783ae15ab2cf37aa3 (diff)
parent70878b6e82fb33f769ab62d43c3dcf0267a3c618 (diff)
downloadrails-4331ee8390908e52e56cf62b2759a152cddfe1b2.tar.gz
rails-4331ee8390908e52e56cf62b2759a152cddfe1b2.tar.bz2
rails-4331ee8390908e52e56cf62b2759a152cddfe1b2.zip
Merge pull request #27076 from y-yagi/fix_postgresql_array_encoding
use `force_encoding` instread of `encode!` to avoid `UndefinedConversionError`
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb
index b969503178..d9daaaa23e 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb
@@ -35,7 +35,7 @@ module ActiveRecord
if value.is_a?(::Array)
result = @pg_encoder.encode(type_cast_array(value, :serialize))
if encoding = determine_encoding_of_strings(value)
- result.encode!(encoding)
+ result.force_encoding(encoding)
end
result
else