Hi all,
I''ve just been tinkering with the tests in
ActiveRecord/test/reflection_test.rb.
test_association_reflection (and its counterpart for testing aggregations)
raise an error due to passing too many parameters to
ActiveRecord::Reflection::AssociationReflection.new:
def test_association_reflection
reflection_for_clients ActiveRecord::Reflection::AssociationReflection.new(
:has_many, :clients, { :order => "id", :dependent => true
}, Firm
)
assert_equal reflection_for_clients,
Firm.reflect_on_association(:clients)
assert_equal Client, Firm.reflect_on_association(:clients).klass
assert_equal Client, Firm.reflect_on_association(:clients_of_firm).klass
end
Earlier version of this test don''t specify the type of association
(has_many, has_one, etc). This looks like a work in progress. Are there
plans to change reflection so that it knows about the different association
types?
Adelle.