class TaskReference < ActiveRecord::Base
  def destroy
    # make sure we do not try to destroy non-existing references
    super if TaskReference.exists? self
  end
end

Got a WTF you want to report? Email us.