Permalink
Browse files

Small refactoring

  • Loading branch information...
Makoto Inoue
Makoto Inoue committed Nov 13, 2008
1 parent 2a1982e commit 551268a47f6d8a3d480e70a5ef2e6ef06e70f41f
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/tc_adapter.rb
View
@@ -12,7 +12,7 @@ def create(resources)
resource = resources[0]
attributes = resource.attributes
- item_id = access_data(resources.first.model) do |item|
+ item_id = access_data(resource.model) do |item|
#Getting the latest id
#TODO:Find out how to get last id using FDB, rather than BDB
cur = BDBCUR::new(item)
@@ -67,7 +67,6 @@ def update(attributes, query)
# Converting {#<Property:User:name>=>"peter", #<Property:User:age>=>22} to {:age=>22, :name=>"peter"}
new_attributes = attributes.inject({}){|total,current| total[current[0].name] = current[1]; total}
-
add_index(new_attributes, query, item_id)
access_data(query.model) do |item|
@@ -211,7 +210,6 @@ def add_index(attributes, query, item_id)
end
end
-
end # class AbstractAdapter
end # module Adapters
end # module DataMapper

0 comments on commit 551268a

Please sign in to comment.