1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/models/binary_field.rb
Jean Boussier d6929e5a09 Handle binary strings in Active Record serialized columns
Serialized attributes stored in BLOB columns will be loaded
with the `ASCII-8BIT` (AKA BINARY) encoding.

So unless the serialized payload is pure ASCII, they need
to have the same internal encoding to be properly compared.

Since the serializer have no way to know how the string will
be stored, it's up to the column type to properly set the
encoding.
2020-10-14 11:57:34 +02:00

6 lines
124 B
Ruby

# frozen_string_literal: true
class BinaryField < ActiveRecord::Base
serialize :normal_blob
serialize :normal_text
end