【发布时间】:2015-12-23 17:47:27
【问题描述】:
有没有办法做到以下几点?:
>items=Item.where('location_id=?',8)
>items.count # 12; now delete all of them
>items.destroy
我知道我可以做到Item.destroy_all('location_id=?',8),但我宁愿在破坏性操作之前先清点一下我的工作。
【问题讨论】:
-
@BradWerth 不是骗子
标签: ruby-on-rails activerecord