Sha256: a1519d219a13dbd2c526149b5120bfbf4ddd9efcbb537e9d26238c6c7d31d19a
Contents?: true
Size: 794 Bytes
Versions: 13
Compression:
Stored size: 794 Bytes
Contents
module Rasti module DB module TypeConverters module PostgresTypes class JSON class << self def column_type_regex /^json$/ end def to_db(value, sub_type) Sequel.pg_json value end def db_classes @db_classes ||= from_db_convertions.keys end def from_db(object) object.public_send from_db_convertions[object.class] end private def from_db_convertions @from_db_convertions ||= { Sequel::Postgres::JSONHash => :to_h, Sequel::Postgres::JSONArray => :to_a } end end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems