eager loading is a relatively new piece of functionality, and
disabling it for rake tasks should *ideally* simply fall back on the
const_missing hook. I'm a little confused why it's not doing that.
Do you have config.threadsafe! set or something?
Either way, unless you have config.threadsafe! set, this is *clearly*
a bug. And if you do, we should probably force the eager loading to
take place irrespective of whether it's a rake task.
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-co...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>
--
Cheers
Koz
Either way, unless you have config.threadsafe! set, this is *clearly*
a bug. And if you do, we should probably force the eager loading to
take place irrespective of whether it's a rake task.
--
config.threadsafe! just does:
# Enable threaded mode. Allows concurrent requests to controller actions and
# multiple database connections. Also disables automatic dependency loading
# after boot, and disables reloading code on every request, as these are
# fundamentally incompatible with thread safety.
def threadsafe!
self.preload_frameworks = true
self.cache_classes = true
self.dependency_loading = false
self.action_controller.allow_concurrency = true
self
end
It's the dependency_loading = false that's messing you up. The
initializer should probably be checking that, not cache_classes.
self.dependency_loading = false
That has a few potential side effects, but how does this look for the
2-3-stable change:
--
Cheers
Koz
That has a few potential side effects, but how does this look for the
2-3-stable change: http://gist.github.com/476526
2.3 needs a 'smallest possible bugfix' change, master can 'do the
right thing' which probably *isn't* adding another conditional.
--
Cheers
Koz