I’m trying to monkey patch active record (and more specifically the
connection adapter) for a rails 3 app. Here is my attempt:
It doesn’t work. When I try to “rake db:migrate” or open a rails console
otherwise load the app, I get the following error:
alias_method': undefined methodvalue_to_boolean’ for class
So, clearly the active record classes (and/or these specific
of active record) aren’t loaded when this initializer runs. So, my
is, given what I’m trying to do, what is the correct or most common way
do this kind of monkey patching? I’m not familiar with the rails 3 way
things but remember hearing/reading a lot about a more standardized way
(API) for configuring/patching/tweaking rails. Is there an idiomatic way
do this properly and at the right time in the application load sequence
I don’t have to have my initializer force-preload these AR classes)?
Thanks in advance for any input!