Skip to content

Commit

Permalink
Removed debugging and changed comments to be more explanatory
Browse files Browse the repository at this point in the history
  • Loading branch information
astupka committed Jan 20, 2011
1 parent d5647b2 commit 471f882
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
class ApplicationController < ActionController::Base
include CentralLogger::Filter

protect_from_forgery
end
6 changes: 3 additions & 3 deletions app/controllers/log_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

class LogController < ApplicationController
respond_to :html, :json
def index
logger.debug("calling index")

def index
setup
query = "@collection.#{params[:query] || 'find_one()'}"
if params[:tail] && !query.include?("find_one")
# find_one does not support skip. This is only called once
# find_one does not support skip.
# The skip is only used the first time someone requests tail
count = eval("#{query}.count()")
skip = count <= TAIL_RECORDS ? 0 : count - TAIL_RECORDS
query = "#{query}.skip(#{skip}) "
Expand Down

0 comments on commit 471f882

Please sign in to comment.