On Nov 13, 2:51 am, Pa Sc
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hi @all
>
> I wrote a rails app and now I want to test it.
> For this, I''d like to use test fixtures wich I created in
.yml-files.
> In my model, each object can include another object. This
> is done by a foreign key. Unfortunately, there is always an error
> becaus of a
> foreign key constraint which fails. Does anybody knows how to solve this
> problem?
> My .yml-file looks like this:
> one:
> id: 1
> person_id: 1
> father: null
> person_type: parent
> two:
> id: 2
> person_id: 2
> father: 1
> person_type: child
>
> If I only insert the first one, it works..
>
> Thanks for your help!
> --
> Posted viahttp://www.ruby-forum.com/.
it isn''t clear if your''e doing single table inheritance (STI)
or a
acts_as_nested_set (or acts_as_tree) structure, but these are both
well-established techniques with constraints on column names, if you
do a search for them
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---