Re: Unnecessary exception raised in AS::Dependencies.load_missing_constant

Andrew White
2010-02-15T18:09:27Z

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 :users needs to be able to pull
Admin::User, ActiveRecord should know how to do that.

Okay, I''m having a stab at rewriting compute_type but I''ve
still got a few failing tests.
BTW, who thought it''d be a good idea to support relative nested
constants for associations? e.g:

module MyApplication
  module Billing
    module Nested
      class Firm < ActiveRecord::Base
      end
    end

    class Account < ActiveRecord::Base
      belongs_to :nested_unqualified_billing_firm,
        :foreign_key => :firm_id,
        :class_name => ''Nested::Firm''
    end
  end
end

Makes life interesting!


Andrew