I have a multi model form (Project with many tasks) and I want to
prevent a task from being saved to the DB if it is empty ie. if there
is no i/p for that task from the user. I tried the following
class Task < ActiveRecord::Base
self.destroy if description.blank?
but i get this
TypeError in ProjectsController#create
can't modify frozen hash
Is there a way to let ActiveRecord know not to save a record (which is
a frozen hash in this case) to the DB?