How to delete older records through ActiveRecord

I have a ruby script that adds records to MySql with no problem, here is
the code:

snmp_data =“name” => LabelDescription,
“time” => My_Time,
“inbits” => SpeedIn.to_i)

I need to be able to delete records after a certain date similar to the
sql statement:

delete * from snmp_datas where date < ‘2015-11-01’;

Any help would be appreciated.



Try this:

Snmpdatas.where(‘date < ?’, ‘2015-11-01’).delete_all