create table foo (id, name, order, ...);
create table foo_bar (id, foo_id, name, value);
foo contains order column with values as (1,2,3,4,5,…10)
assuming foo_bar contains multiple records for each foo.
How do I delete foos whose order values are 3..6 and its dependent records?
If your relation is like above following code will work
OR Just
Ref delete
EDITED
From little i know your question i think you have something like following
foo table
foo_bar table
Then user following
orderinstead ofidEDITED: Use
destroy_allto Destroys the records by instantiating each record and calling its {#destroy}[rdoc-ref:Persistence#destroy] method.