Sha256: 8849c692b6920b3c06cc3afdfc421575498ab4727222ee0d00fc34fb9a5a25bd
Contents?: true
Size: 461 Bytes
Versions: 5
Compression:
Stored size: 461 Bytes
Contents
# frozen_string_literal: true # @private module PGTrunk::Serializers # @private # Cast the attribute value as an array, not caring about its content. class ArraySerializer < ActiveRecord::Type::Value def cast(value) case value when ::NilClass then [] when ::Array then value else [value] end end def serialize(value) value end end ActiveModel::Type.register(:pg_trunk_array, ArraySerializer) end
Version data entries
5 entries across 5 versions & 1 rubygems