You'r welcome :)
A slight fix is needed. The version above is not running in the test
environment. Here is the new version.
*config/application.rb*
config.to_prepare do
require 'bug_fix'
::BugFix.apply
end
*lib/bug_fix.rb*
module BugFix
def self.apply
BugFix::ActiveRecord.apply
end
module ActiveRecord
def self.apply
::ActiveRecord::Base.descendants.select do |k|
k.reflections.values.each do |r|
r.instance_eval{ @klass = Object.const_get(@klass.name) if @klass
}
end
end
true
end
end
end
I spent quite a while wondering why my application is telling "Hobo can't
find reverse association for sth". All the models were correct. Then I
found out DRML editing was causing class reload. Then I found out Rails was
wrong about reloading files.
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.