> I don't think it's expected behavior that requiring 'application' loads it a
> second time.

No, double requiring isn't expected.

> Looking at the code, it appears that #require_dependency (which calls
> #require_or_load) has two different mechanisms: :load or :require.  I'm
> curious if anyone knows the reasoning for this, and why :load is the
> default. But even if it did use #require, #require_or_load expands the path
> of the filename, so simply requiring application would still re-load it.
>
> I'm also wondering if #require_dependency is necessary in the dispatcher.
>  Would simply using #require do the trick?

require_dependency has two different load mechanisms to support the
reloading we do in development mode.  But some of that code (including
require_dependency) is so old it predates active support, and I'm sure
there's some cruft in there.  Perhaps it can be simplified.

> I'm willing to pursue a patch to fix this, I just wanted to see if anyone
> had any insights.

The correct fix is to use require_dependency 'application' as it works
with reloading.  The double require is probably happening because
require_dependency normalises the path.

What are you doing in the console which triggers this?   It's probably
a bug in rspec too.

> Thanks,
> Brandon
>



-- 
Cheers

Koz

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to