mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
d6929e5a09
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.
6 lines
124 B
Ruby
6 lines
124 B
Ruby
# frozen_string_literal: true
|
|
|
|
class BinaryField < ActiveRecord::Base
|
|
serialize :normal_blob
|
|
serialize :normal_text
|
|
end
|