debugging_tools.rb

Path: lib/has_many_polymorphs/debugging_tools.rb
Last Update: Thu Jul 05 18:12:39 -0400 2012

Debugging tools for Has_many_polymorphs.

Enable the different tools by setting the environment variable HMP_DEBUG. Settings with special meaning are "ruby-debug", "trace", and "dependencies".

Code generation

Enabled by default when HMP_DEBUG is set.

Ouputs a folder generated_models/ in Rails.root containing valid Ruby files explaining all the ActiveRecord relationships set up by the plugin, as well as listing the line in the plugin that called each particular association method.

Ruby-debug

Enable by setting HMP_DEBUG to "ruby-debug".

Starts ruby-debug for the life of the process.

Trace

Enable by setting HMP_DEBUG to "trace".

Outputs an indented trace of relevant method calls as they occur.

Dependencies

Enable by setting HMP_DEBUG to "dependencies".

Turns on Rails’ default dependency logging.

Methods

Constants

GENERATED_CODE_DIR = "#{base_dir}/generated_models"

External Aliases

method_missing -> original_method_missing

Public Instance methods

[Validate]