fixed should_have_many :through bug #60, and added .svn to gitignore.

This commit is contained in:
Tammer Saleh 2008-07-31 22:36:15 -04:00
parent cefcfe1205
commit 2cb29f5e6d
2 changed files with 5 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
test/rails_root/log/*.log
doc
coverage
.svn/

View File

@ -372,7 +372,10 @@ module ThoughtBot # :nodoc:
assert reflection, "#{klass.name} does not have any relationship to #{association}"
assert_equal :has_many, reflection.macro
associated_klass = (reflection.options[:class_name] || association.to_s.classify).constantize
associated_klass_name = reflection.options[:class_name]
associated_klass_name = reflection.options[:source].to_s.classify if associated_klass_name.blank?
associated_klass_name = association.to_s.classify if associated_klass_name.blank?
associated_klass = associated_klass_name.constantize
if through
through_reflection = klass.reflect_on_association(through)