# Cannot destroy child records

**URL:** <https://www.ruby-forum.com/t/cannot-destroy-child-records/144437>\
**Category:** Rails\
**Created:** [July 29, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/cannot-destroy-child-records/144437 "2008-07-29T17:50:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![remcoh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@remcoh](https://www.ruby-forum.com/u/remcoh)\
**Post date:** [July 29, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/cannot-destroy-child-records/144437/1 "2008-07-29T17:50:59Z")

</div>

Hi, i am lost here,

i have these models:

class Shift \< ActiveRecord::Base  
has\_many :transactions,:dependent =\> :destroy  
has\_one :exchangeproposal

class Transaction \< ActiveRecord::Base  
belongs\_to :shift  
has\_many :exchangeproposals

class Exchangeproposal \< ActiveRecord::Base  
belongs\_to :shift  
belongs\_to :transaction

with these models i can’t destroy an exchangeproposal object

e=Exchangeproposal.find(100).destroy  
=\> #\<Transaction id: 7, shift\_id: 14591, group\_id: 47, user\_from\_id:  
nil, user\_to\_id: nil, date: nil, soort: 2, status: 2, created\_at:  
“2008-07-29 17:17:36”, updated\_At: nil\>

instead i get back a transaction??

now if i remove the belong\_to :shift in the model,  
how can this be explained?

thanks
