# encoding: utf-8 require 'dm-core' require 'dm-postgres-adapter' require 'dm-pg-json/property/pgjson' require 'dm-pg-json/version' module DataMapper module Migrations module PostgresAdapter def property_schema_hash(property) schema = super if property.kind_of?(Property::PgJSON) schema.delete(:length) end schema end end end module PostgresJSON def self.included(base) base.extend ClassMethods end module ClassMethods # Types for PostgreSQL databases. # # @return [Hash] types for PostgreSQL databases. # # @api private def type_map super.merge(Property::PgJSON => {:primitive => 'JSON'}).freeze end end end end DataMapper::Adapters::PostgresAdapter.send(:include, ::DataMapper::PostgresJSON)