module Hydroponics module Actions def dupe(table, target_count) table = table.to_sym first_row = @db[table].first first_row.delete(:id) current_count = @db[table].count time1 = Time.now if target_count > current_count @db[table].multi_insert([first_row] * (target_count - current_count)) else @db[table].filter("id > #{target_count}").delete end time2 = Time.now (time2 - time1).to_s + 's' end end end