Skip to content

Commit

Permalink
Get rid of 'puts' in favor of a pure debugging statement, as this app…
Browse files Browse the repository at this point in the history
…ears a lot during various operations.
  • Loading branch information
peakpg committed Apr 29, 2011
1 parent 150c29a commit 0ef2aa6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/cms/behaviors/soft_deleting.rb
Expand Up @@ -10,9 +10,8 @@ def uses_soft_delete?
!!@uses_soft_delete
end

def handle_missing_table_error_during_startup(e)
puts e.inspect
Rails.logger.info e.inspect
def handle_missing_table_error_during_startup(message, e)
Rails.logger.debug "#{message}: #{e.inspect}"
end

def uses_soft_delete(options={})
Expand All @@ -29,9 +28,9 @@ class << self
# By default, all queries for blocks should filter out deleted rows.
begin
default_scope where(:deleted => false)
# This may fail during gem loading, if no DB exists. Log it and move on.
# This may fail during gem loading, if no DB or the table does not exist. Log it and move on.
rescue StandardError => e
handle_missing_table_error_during_startup(e)
handle_missing_table_error_during_startup("Can't set a default_scope for soft_deleting", e)
end
end
end
Expand Down

0 comments on commit 0ef2aa6

Please sign in to comment.