On May 9, 6:33 pm, Brian <[email protected]> wrote:
> On May 9, 1:18 pm, Frederick Cheung <[email protected]>
> wrote:
>
>
>
> > Does removing the structure: line make a difference ?
>
> > Fred
>
> It does, but then I get similar errors loading other fixtures.  Right
> now, my cache fixture only has the two entries generated when I
> created the model, but I'd like to add more meaningful test data in
> there to start writing my unit tests.  References to structures will
> be fairly important.

ah, I know what's happening. The default pluralization rules rails has
screw up cache/caches, so when rails loads the fixtures it tries to
look for the wrong model class so the fixture data is inserted without
the structure having being turned into structure_id
Adding an inflector rule should do the trick eg stick

ActiveSupport::Inflector.inflections do |inflect|
   inflect.irregular 'cache', 'caches'
end


in an initializer.

Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to