dm-persevere-adapter 0.60.0 → 0.60.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/dm/property.rb +8 -2
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.60.0
1
+ 0.60.1
data/lib/dm/property.rb CHANGED
@@ -2,15 +2,21 @@ module DataMapper
2
2
  class Property
3
3
 
4
4
  def to_json_schema_hash(repo)
5
+
5
6
  tm = repository(repo).adapter.type_map
7
+ type_information = tm[type]
8
+ if type_information.nil? && type.respond_to?(:primitive)
9
+ type_information = tm[type.primitive]
10
+ end
11
+
6
12
  json_hash = Hash.new
7
- json_hash = { "type" => tm[type][:primitive] }
13
+ json_hash = { "type" => type_information[:primitive] }
8
14
  json_hash.merge!({ "optional" => true }) unless required?
9
15
  json_hash.merge!({ "unique" => true}) if unique?
10
16
  json_hash.merge!({ "position" => @position }) unless @position.nil?
11
17
  json_hash.merge!({ "prefix" => @prefix }) unless @prefix.nil?
12
18
  json_hash.merge!({ "separator" => @separator }) unless @separator.nil?
13
- json_hash.merge!( tm[type].reject{ |key,value| key == :primitive } )
19
+ json_hash.merge!( type_information.reject{ |key,value| key == :primitive } )
14
20
 
15
21
  json_hash
16
22
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 60
8
- - 0
9
- version: 0.60.0
8
+ - 1
9
+ version: 0.60.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ivan R. Judson