dm-appengine 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/appengine_adapter.rb +9 -9
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/appengine_adapter.rb
CHANGED
@@ -62,13 +62,13 @@ module DataMapper
|
|
62
62
|
properties = model.properties(repository.name)
|
63
63
|
|
64
64
|
kind = self.kind(model)
|
65
|
-
keys =
|
65
|
+
keys = properties.key
|
66
66
|
raise "Multiple keys in #{resource.inspect}" if keys.size > 1
|
67
67
|
if keys.size == 1
|
68
|
-
key = attributes.delete(keys
|
68
|
+
key = attributes.delete(keys.first.name)
|
69
69
|
key = key.to_s if key
|
70
70
|
end
|
71
|
-
if key && !(key == 0 || keys
|
71
|
+
if key && !(key == 0 || keys.first.serial?)
|
72
72
|
entity = Datastore::Entity.new(kind, key)
|
73
73
|
else
|
74
74
|
entity = Datastore::Entity.new(kind)
|
@@ -85,8 +85,8 @@ module DataMapper
|
|
85
85
|
Datastore.put(entities)
|
86
86
|
resources.zip(entities) do |resource, entity|
|
87
87
|
key = entity.key
|
88
|
-
if
|
89
|
-
|
88
|
+
if serial = resource.model.serial(name)
|
89
|
+
serial.set!(resource, key.get_id)
|
90
90
|
end
|
91
91
|
resource.instance_variable_set :@__entity__, entity
|
92
92
|
end
|
@@ -273,7 +273,7 @@ module DataMapper
|
|
273
273
|
end
|
274
274
|
|
275
275
|
def parse_comparison(op)
|
276
|
-
property = op.
|
276
|
+
property = op.subject
|
277
277
|
value = op.value
|
278
278
|
if @maybe_get
|
279
279
|
if property.key?
|
@@ -299,8 +299,8 @@ module DataMapper
|
|
299
299
|
if filter_op.nil?
|
300
300
|
raise ArgumentError, "#{op.class} is not a supported comparison"
|
301
301
|
end
|
302
|
-
name = property_name(op.
|
303
|
-
value = property_value(op.
|
302
|
+
name = property_name(op.subject)
|
303
|
+
value = property_value(op.subject, op.value)
|
304
304
|
@query.filter(name, filter_op, value)
|
305
305
|
end
|
306
306
|
end
|
@@ -341,7 +341,7 @@ module DataMapper
|
|
341
341
|
end
|
342
342
|
|
343
343
|
def run
|
344
|
-
key_prop = @model.key(@adapter_name)
|
344
|
+
key_prop = @model.key(@adapter_name).first.field
|
345
345
|
entities = get_entities
|
346
346
|
hashes = entities.map do |entity|
|
347
347
|
entity_to_hash(key_prop, entity)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-appengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Brown
|
@@ -9,7 +9,7 @@ autorequire: dm-appengine
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-15 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|