Skip to content

Commit

Permalink
refactored code. renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
podviaznikov committed Nov 29, 2011
1 parent 98d06c3 commit 17632fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/dao/dao.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ Dao = exports.Dao = class Dao
# Remove entity by `id`.
remove: (id, callback) => @db.remove @bucket, id, callback

# Remove all entities from `bucket`. TODO (anton) rename to removeAll
deleteAll: =>
# Remove all entities from `bucket`.
removeAll: =>
@db.getAll @bucket, (err, objects) =>
if !err
objects.forEach (object) =>
console.log "removing entity from bucket", @bucket, "with id =", object.meta.key if @log
@db.remove @bucket, object.meta.key
@remove object.meta.key

# Checks if such key exists in database. Callback takes 2 parameters: `err` and `exists` boolean parameter
exists: (id, callback) => @db.exists @bucket, id, callback
Expand All @@ -51,7 +51,7 @@ Dao = exports.Dao = class Dao
walk: (id, spec, callback) =>
linkPhases = spec.map (unit) ->
bucket: unit[0] or '_', tag: unit[1] or '_', keep: unit[2]?
console.log "waling phases", linkPhases
console.log "walking phases", linkPhases
@db
.add({bucket: @bucket, key_filters: [["eq", id]]})
.link(linkPhases)
Expand Down
1 change: 0 additions & 1 deletion lib/massive.git.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
async = require "async"
_ = require "underscore"
sanitize = require("validator").sanitize
validators = require "./validators/input.validators"
utils = require("./objects/utils")

Expand Down
10 changes: 5 additions & 5 deletions test/helper/helper.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ helper.createUserWithRepos = (username, firstReponame, firstRepotype, secondRepo


helper.deleteAll = ->
usersDao.deleteAll()
reposDao.deleteAll()
commitsDao.deleteAll()
treesDao.deleteAll()
blobsDao.deleteAll()
usersDao.removeAll()
reposDao.removeAll()
commitsDao.removeAll()
treesDao.removeAll()
blobsDao.removeAll()

0 comments on commit 17632fc

Please sign in to comment.