lib/dbox/database.rb in dbox-0.5.2 vs lib/dbox/database.rb in dbox-0.5.3
- old
+ new
@@ -144,9 +144,14 @@
def add_entry(path, is_dir, parent_id, modified, revision, hash)
insert_entry(:path => path, :is_dir => is_dir, :parent_id => parent_id, :modified => modified, :revision => revision, :hash => hash)
end
+ def update_entry_by_id(id, fields)
+ raise(ArgumentError, "id cannot be null") unless id
+ update_entry(["WHERE id=?", id], fields)
+ end
+
def update_entry_by_path(path, fields)
raise(ArgumentError, "path cannot be null") unless path
update_entry(["WHERE path=?", path], fields)
end