Permalink
Browse files

documentsのテーブル種類を Groonga::Array -> Groonga::Hash に変更。

  • Loading branch information...
1 parent db33984 commit 94c8a5cf5b17a8414643250b9324fc0ff864840b @ongaeshi committed Aug 11, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/milkode/cdstk/cdstk.rb
@@ -367,7 +367,7 @@ def db_create(filename)
unless dbfile.exist?
Groonga::Database.create(:path => dbfile.to_s)
Groonga::Schema.define do |schema|
- schema.create_table("documents") do |table|
+ schema.create_table("documents", :type => :hash) do |table|
table.string("path")
table.string("shortpath")
table.text("content")
@@ -447,10 +447,10 @@ def db_add_file(stdout, filename, shortpath)
# end
isNewFile = false
- record = @records.find{|r| r.path == values[:path] }
+ record = documents[ values[:path] ]
unless record
- document = documents.add
+ document = documents.add(values[:path])
isNewFile = true
else
document = record

0 comments on commit 94c8a5c

Please sign in to comment.