Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-16 Thread Andrew White
On 15 Feb 2010, at 14:26, Yehuda Katz wrote: > Actually that's precisely where it belongs. ActiveSupport::Dependencies > should mirror the Ruby logic exactly (in other words, it should be possible > to require all the files manually and have everything work). If > Admin::Account has_many :user

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-15 Thread Andrew White
On 15 Feb 2010, at 14:26, Yehuda Katz wrote: > Actually that's precisely where it belongs. ActiveSupport::Dependencies > should mirror the Ruby logic exactly (in other words, it should be possible > to require all the files manually and have everything work). If > Admin::Account has_many :user

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-15 Thread Yehuda Katz
Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 On Mon, Feb 15, 2010 at 6:15 AM, Andrew White wrote: > > On 15 Feb 2010, at 13:31, Yehuda Katz wrote: > > > I wouldn't. I consider Rails' lookup from disk to be an alternate form of > constant lookup, and I'd want it to use semantics that ar

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-15 Thread Andrew White
On 15 Feb 2010, at 13:31, Yehuda Katz wrote: > I wouldn't. I consider Rails' lookup from disk to be an alternate form of > constant lookup, and I'd want it to use semantics that are identical to > Ruby's semantics: > > class Foo::Bar > Baz > # normal Ruby: will search Foo::Bar::Baz and Obj

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-15 Thread Yehuda Katz
Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 On Mon, Feb 15, 2010 at 5:19 AM, Andrew White wrote: > > On 15 Feb 2010, at 12:11, Yehuda Katz wrote: > > > I couldn't think of or find any reason for these cases to be different. > My guess is that the behavior was added to classes at some

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-15 Thread Andrew White
On 15 Feb 2010, at 12:11, Yehuda Katz wrote: > I couldn't think of or find any reason for these cases to be different. My > guess is that the behavior was added to classes at some point (due to STI > needs) but never added to modules (since it never came up). In any event, > there's no way to

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-15 Thread Andrew White
On 15 Feb 2010, at 01:32, Yehuda Katz wrote: > What I'd like to understand is what the various cases are that could trigger > this branch. In particular, I'm interested in understanding the cases without > reference to ActiveRecord (which it looks like you and others have started to > do). Ac

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-15 Thread Yehuda Katz
Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 On Mon, Feb 15, 2010 at 12:10 AM, Andrew White wrote: > On 15 Feb 2010, at 01:32, Yehuda Katz wrote: > > > What I'd like to understand is what the various cases are that could > trigger this branch. In particular, I'm interested in understand

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-15 Thread Andrew White
On 15 Feb 2010, at 01:32, Yehuda Katz wrote: > What I'd like to understand is what the various cases are that could trigger > this branch. In particular, I'm interested in understanding the cases without > reference to ActiveRecord (which it looks like you and others have started to > do). Wel

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-14 Thread George
Perhaps Nick Seckar remembers: http://dev.rubyonrails.org/changeset/4779 Corresponding git commit: 2b37d59976268013b7e518e5af244947f688d315 Something to do with anonymous modules, I guess. The commit message doesn't explain why the raise is necessary, though--tests run fine if you revert the chan

Re: [Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-14 Thread Yehuda Katz
What I'd like to understand is what the various cases are that could trigger this branch. In particular, I'm interested in understanding the cases without reference to ActiveRecord (which it looks like you and others have started to do). It seems reasonable to remove the exception, but I'd like to

[Rails-core] Unnecessary exception raised in AS::Dependencies.load_missing_constant

2010-02-14 Thread Ryan Kinderman
There seems to be a bug in Rails dependency auto-loading logic that is detailed here: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2283 Andrew White created the issue in March of 2009, and it continues to be an issue despite recent Rails 3 commits. A number of patches have