Displaying 2 results from an estimated 2 matches for "instructional_objects".
2008 Mar 12
2
nested routes with a 2-way has_many using join table?
...through a join table (so it''s like a habtm
without the habtm).
For the next version of our app, we''re refactoring to RESTful, and i''m
having trouble with my nested resources/routes. I tried this, in
routes.rb:
map.resources :assets do |assets|
assets.resources :instructional_objects
end
map.resources :instructional_objects do |instructional_objects|
instructional_objects.resources :assets
end
thinking that would let me do
instructional_objects/:id/assets
to get all the assets belonging to that instructional_object
and
assets/:id/instructional_objects
for v...
2008 Mar 05
4
has_many_polymorphs is breaking my spec file
...rb.
The classes all get labelled with ''properties'', and i set out to write the
Property class first, using bdd of course. This all went fine. However,
when i came to start testing that the labelling was working properly, i
added the following code:
POLYMORPHIC_TABLENAMES = [:instructional_objects, :resources, :lessons,
:courses]
#this is breaking tests currently
has_many_polymorphs :labellables,
:from => POLYMORPHIC_TABLENAMES,
:through => :labellings,
:dependent => :destroy
Now, whenever i run the spec file, it bombs out as soon as it hits a
reference to the Prope...