Skip to content

Commit

Permalink
select once.
Browse files Browse the repository at this point in the history
  • Loading branch information
ongaeshi committed Aug 10, 2011
1 parent f34d859 commit db33984
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/milkode/cdstk/cdstk.rb
Expand Up @@ -400,6 +400,9 @@ def db_open(filename)
else
raise "error : #{dbfile.to_s} not found!!"
end

documents = Groonga::Context.default["documents"]
@records = documents.select.records
end

def db_delete(filename)
Expand Down Expand Up @@ -443,12 +446,8 @@ def db_add_file(stdout, filename, shortpath)
# document = _documents.to_a[0].key
# end

table = documents.select
records = table.records

isNewFile = false

record = records.find{|r| r.path == values[:path] }
record = @records.find{|r| r.path == values[:path] }

unless record
document = documents.add
Expand Down

0 comments on commit db33984

Please sign in to comment.