Above can be simplified to:

```ruby
if autosave
  records_to_destroy = records.select(&:marked_for_destruction?)
  records_to_destroy.each { |record| association.destroy(record) }
  records -= records_to_destroy
end
```