# Destroy / delete with optimistic locking

**URL:** <https://www.ruby-forum.com/t/destroy-delete-with-optimistic-locking/138019>\
**Category:** Rails\
**Created:** [May 19, 2008, 3:26pm UTC](https://www.ruby-forum.com/t/destroy-delete-with-optimistic-locking/138019 "2008-05-19T15:26:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [May 19, 2008, 3:26pm UTC](https://www.ruby-forum.com/t/destroy-delete-with-optimistic-locking/138019/1 "2008-05-19T15:26:23Z")

</div>

Hi,

Some of my models use optimistic locking, but it doesn’t change the  
SQL delete command. What I get is just:  
DELETE FROM `things` WHERE `id` = 62

Can I do anything so that the lock version also appears in this query  
(which would make it play nice with optimistic locking)?

Thanks,  
Helzer
