lib/dm-pg-json.rb in dm-pg-json-0.0.1 vs lib/dm-pg-json.rb in dm-pg-json-0.1.0
- old
+ new
@@ -1,22 +1,19 @@
# encoding: utf-8
require 'dm-core'
require 'dm-postgres-adapter'
+require 'dm-pg-json/property/pgjson'
require 'dm-pg-json/version'
module DataMapper
- class Property
- autoload :PgJSON, 'dm-pg-json/property/pgjson'
- end
-
module Migrations
module PostgresAdapter
def property_schema_hash(property)
schema = super
- if property.kind_of?(Property::PgJSON)
+ if property.kind_of?(::DataMapper::Property::PgJSON)
schema.delete(:length)
end
schema
end
@@ -33,11 +30,11 @@
#
# @return [Hash] types for PostgreSQL databases.
#
# @api private
def type_map
- super.merge(Property::PgJSON => {:primitive => 'JSON'}).freeze
+ super.merge(::DataMapper::Property::PgJSON => {:primitive => 'JSON'}).freeze
end
end
end
end
-DataMapper::Adapters::PostgresAdapter.send(:include,DataMapper::PostgresJSON)
+DataMapper::Adapters::PostgresAdapter.send(:include, ::DataMapper::PostgresJSON)