pinnymz/migration_comments — Issue #2: Loading annotate/annotate_models breaks ActiveRecord dynamic finders
Author: pinnymz
Created: 2012-02-27 20:22:34+00:00
State: open

'annotate/annotate_models.rb' uses a monkey patched :method_missing to get around the problem of recognizing unknown macros ('acts_as_something' and the like). This monkey patch is only meant to be loaded when running the rake task to create annotations.

Unfortunately, we are requiring the 'annotate/annotate_models.rb' file to load in order to modify the output with comments. If we remove the requirement, our modification hook will never be inserted because the environment (and all gems) are loaded by the annotation rake task before the 'annotate/annotate_models.rb' file.

We'll need to find an alternative hooking method that doesn't require including the 'method_missing' monkey patch.