Navigation Menu

Skip to content

Commit

Permalink
groonga: Ignore missing record by delete command
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 24, 2014
1 parent 5abb7dc commit a9f5890
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/droonga/plugins/groonga/delete.rb
Expand Up @@ -79,9 +79,11 @@ def validate_parameters
def delete_record(table_name, parameters={})
table = @context[table_name]
if parameters[:id]
table.delete(parameters[:id].to_i)
record = table[parameters[:id].to_i]
record.delete if record and record.valid_id?
else
table.delete(parameters[:key])
record = table[parameters[:key]]
record.delete unless record.nil?
end
true
end
Expand Down

0 comments on commit a9f5890

Please sign in to comment.