mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
fixed should_have_many :through bug #60, and added .svn to gitignore.
This commit is contained in:
parent
cefcfe1205
commit
2cb29f5e6d
2 changed files with 5 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
test/rails_root/log/*.log
|
||||
doc
|
||||
coverage
|
||||
.svn/
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue