public
Rubygem
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
fixed should_have_many :through bug #60, and added .svn to gitignore.
tsaleh (author)
Thu Jul 31 19:36:15 -0700 2008
commit  2cb29f5e6daf217299296282e753b5f0bef9ff37
tree    3d01fc445b30eb1e85208096b0360f59c070c406
parent  cefcfe1205f3636615e0562bba0ff60d3bf02922
...
1
2
3
 
...
1
2
3
4
0
@@ -1,3 +1,4 @@
0
 test/rails_root/log/*.log
0
 doc
0
 coverage
0
+.svn/
...
372
373
374
375
 
 
 
 
376
377
378
...
372
373
374
 
375
376
377
378
379
380
381
0
@@ -372,7 +372,10 @@ module ThoughtBot # :nodoc:
0
             assert reflection, "#{klass.name} does not have any relationship to #{association}"
0
             assert_equal :has_many, reflection.macro
0
 
0
- associated_klass = (reflection.options[:class_name] || association.to_s.classify).constantize
0
+ associated_klass_name = reflection.options[:class_name]
0
+ associated_klass_name = reflection.options[:source].to_s.classify if associated_klass_name.blank?
0
+ associated_klass_name = association.to_s.classify if associated_klass_name.blank?
0
+ associated_klass = associated_klass_name.constantize
0
 
0
             if through
0
               through_reflection = klass.reflect_on_association(through)

Comments

    No one has commented yet.