Turn of dependencies so that a destroy will not destroy chil

0 views
Skip to first unread message

New Ruby

unread,
Aug 29, 2007, 4:49:29 PM8/29/07
to rubyonra...@googlegroups.com
Hello,
Can i turn of dependencies so that a destroy on one table will not
automatically destroy data in the child table?
Thanks
--
Posted via http://www.ruby-forum.com/.

Tom

unread,
Aug 29, 2007, 5:23:46 PM8/29/07
to Ruby on Rails: Talk
Are you talking about has_many, belongs_to helpers or table
inheritance?

New Ruby

unread,
Aug 29, 2007, 5:44:15 PM8/29/07
to rubyonra...@googlegroups.com
Tom wrote:
> Are you talking about has_many, belongs_to helpers or table
> inheritance?

Hello,
Ya I don’t think I explained that to well. I have a model test that has
a belongs_to :test2. When I delete from test it also deletes from test2.
What I forgot to say is that I am using acts as paranoid so what my real
problem is that when I delete from test is sets the deleted_at which is
fine. But it also sets the deleted_at in test2 which is data that I
still want to be able to see even though the parent has been removed.
Basically if it is deleted from test I still want to be able to see it
in test2. I hope that makes more sense.

Thanks again.

Adam Cohen

unread,
Aug 29, 2007, 6:09:11 PM8/29/07
to rubyonra...@googlegroups.com
On 8/29/07, New Ruby <rails-mai...@andreas-s.net> wrote:
>
> Tom wrote:

set :dependent => false (or nil) on the association

Adam

New Ruby

unread,
Aug 30, 2007, 10:21:58 AM8/30/07
to rubyonra...@googlegroups.com

Great.... Thanks

Reply all
Reply to author
Forward
0 new messages