[rspec-users] has_many_polymorphs is breaking my testing

Max Williams toastkid.williams at gmail.com
Wed Feb 27 07:12:20 EST 2008


I have a class Property that was testing fine until i added the following to
it:

  has_many_polymorphs :labelled,
    :from => [:instructional_objects, :lessons, :courses],
    :through => :labels,
    :dependent => :destroy

(in other words, 'labels' is a join table through which various objects can
be labelled with a property)

Now my spec file crashes, saying that Property isn't defined in property.rb:
does anyone know what's gone wrong here?

/home/jars/rails/lesson_planner/branches/max/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:249:in
`load_missing_constant': Expected
/home/jars/rails/lesson_planner/branches/max/app/models/property.rb to
define Property (LoadError)
        from
/home/jars/rails/lesson_planner/branches/max/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:452:in
`const_missing'
        from
/home/jars/rails/lesson_planner/branches/max/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:464:in
`const_missing'
        from ./spec/models/property_spec.rb:3
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080227/01ae53a0/attachment.html 


More information about the rspec-users mailing list