Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reflect on aggregation ignores :class_name option (fixes #4599) [lars…
… pind]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4175 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Apr 6, 2006
1 parent 26e1875 commit 2fa5bf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/reflection.rb
Expand Up @@ -97,7 +97,7 @@ def ==(other_aggregation)
# Holds all the meta-data about an aggregation as it was specified in the Active Record class.
class AggregateReflection < MacroReflection #:nodoc:
def klass
@klass ||= Object.const_get(class_name)
@klass ||= Object.const_get(options[:class_name] || class_name)
end

private
Expand Down
2 changes: 2 additions & 0 deletions activerecord/test/reflection_test.rb
Expand Up @@ -74,6 +74,8 @@ def test_aggregation_reflection
assert_equal reflection_for_address, Customer.reflect_on_aggregation(:address)

assert_equal Address, Customer.reflect_on_aggregation(:address).klass

assert_equal Money, Customer.reflect_on_aggregation(:balance).klass
end

def test_has_many_reflection
Expand Down

0 comments on commit 2fa5bf0

Please sign in to comment.