This code is ugly, how to do better?
todos = Todo.all
@todos_1 = Array.new
@todos_2 = Array.new
@todos_3 = Array.new
todos.each do |doc|
if doc.category == nil
@ntodos_1 << doc
end
if doc.category == "something"
@todos_2 << doc
end
if doc.frame == "whatever"
@todos_3 << doc
end
doc.frame == 'whatever' && doc.category == 'something'? Can you please provide a proper specification of what the code should be doing, preferably including test cases?