0
如何在ActiveRecord中實現下面的查詢?使用活動記錄刪除
"delete from model where date(created_at)=#{some_date}"
其中created_at是sql datetime字段。我能想到
一種選擇是計算
start_date = starting time of the day
end_date = end time of the day
和
Model.delete_all('created_at' >= start_date, 'created_at' < end_date)
任何其他清潔的選擇?