Skip to content
Browse files

don't be so furious with the logging

  • Loading branch information...
1 parent d8fe7c3 commit 4a15ff2db0e1c2164502a9811f66cb1d6aa48e44 @mccolin committed
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/do_document_fields.rb
View
14 lib/do_document_fields.rb
@@ -30,7 +30,7 @@ def do_document_fields(*args)
extend ClassMethods
include InstanceMethods
column_name = args.shift || :document
- logger.debug "DOCUMENT_FIELDS: do_document_fields turned on for #{self.name} in column #{column_name}"
+ ##logger.debug "DOCUMENT_FIELDS: do_document_fields turned on for #{self.name} in column #{column_name}"
serialize "#{column_name}".to_sym, Hash
cattr_accessor :document_column_names
@@ -71,17 +71,17 @@ def declare_document_field(*args)
column_name = args.shift; raise NoColumnNameSpecified unless column_name
field_name = args.shift; raise NoFieldNameSpecified unless field_name
field_opts = args.shift || Hash.new
- logger.debug "DOCUMENT_FIELDS: declare_document_field invoked for \"#{column_name}\" column with \"#{field_name}\" field"
+ ##logger.debug "DOCUMENT_FIELDS: declare_document_field invoked for \"#{column_name}\" column with \"#{field_name}\" field"
self.send("document_fields").send("<<", field_name)
self.send("#{column_name}_fields").send("<<", field_name)
define_method(field_name) do
- logger.debug "DOCUMENT_FIELDS: accessor invoked for field:#{field_name} on column:#{column_name}"
+ #logger.debug "DOCUMENT_FIELDS: accessor invoked for field:#{field_name} on column:#{column_name}"
document_body = self.send(column_name) || Hash.new
document_body[field_name]
end
define_method("#{field_name}=") do |val|
- logger.debug "DOCUMENT_FIELDS: updater invoked for field:#{field_name} on column:#{column_name}"
+ #logger.debug "DOCUMENT_FIELDS: updater invoked for field:#{field_name} on column:#{column_name}"
document_body = self.send(column_name) || Hash.new
document_body[field_name] = val
self.send("#{column_name}=", document_body)
@@ -103,7 +103,7 @@ def declare_document_index(*args)
class_name = self.name.underscore
class_table_name = self.table_name
index_table_name = "document_indexes_for_#{class_table_name}"
- logger.debug "DOCUMENT_FIELDS: declare_document_index invoked for \"#{column_name}\" column with \"#{field_name}\" field on #{class_name}"
+ #logger.debug "DOCUMENT_FIELDS: declare_document_index invoked for \"#{column_name}\" column with \"#{field_name}\" field on #{class_name}"
self.send("document_indexes").send("<<", field_name)
self.send("#{column_name}_indexes").send("<<", field_name)
@@ -138,7 +138,7 @@ def find_with_#{column_name}(hash={})
# after_save callback to update index
define_method("update_document_index_#{column_name}_#{field_name}_after_save") do
- logger.debug "DOCUMENT_FIELDS: update_document_index_after_save invoked for \"#{field_name}\"; not yet updating"
+ #logger.debug "DOCUMENT_FIELDS: update_document_index_after_save invoked for \"#{field_name}\"; not yet updating"
class_name = self.class.name.underscore
class_table_name = self.class.table_name
index_table_name = "document_indexes_for_#{class_table_name}"
@@ -149,7 +149,7 @@ def find_with_#{column_name}(hash={})
# after_destroy callback to update index
define_method("update_document_index_#{column_name}_#{field_name}_after_destroy") do
- logger.debug "DOCUMENT_FIELDS: update_document_index_after_destroy invoked for \"#{field_name}\""
+ #logger.debug "DOCUMENT_FIELDS: update_document_index_after_destroy invoked for \"#{field_name}\""
class_name = self.class.name.underscore
class_table_name = self.class.table_name
index_table_name = "document_indexes_for_#{class_table_name}"

0 comments on commit 4a15ff2

Please sign in to comment.
Something went wrong with that request. Please try again.