Sha256: 8ddccc5042df84ef9daddc4f8f88e506437b94475afa5dcef0c6b8d97de96647
Contents?: true
Size: 403 Bytes
Versions: 18
Compression:
Stored size: 403 Bytes
Contents
module Superstore module Types class ArrayType < BaseType def encode(array) raise ArgumentError.new("#{array.inspect} is not an Array") unless array.kind_of?(Array) array.to_a.to_json end def decode(str) return nil if str.blank? ActiveSupport::JSON.decode(str) end def typecast(value) value.to_a end end end end
Version data entries
18 entries across 18 versions & 1 rubygems