do not save if previous save had validation problems.

this prevents test failures if you use it on a db that has been used after the aasm upgrade (forward compatible)
This commit is contained in:
Reinier Balt 2011-06-10 23:11:26 +02:00
parent 9f8e55c672
commit 65e3a8ff30

View file

@ -90,7 +90,7 @@ class TodosController < ApplicationController
@saved = @todo.save
# Fix for #977 because AASM overrides @state on creation
@todo.update_attribute('state', specified_state) unless specified_state == "immediate"
@todo.update_attribute('state', specified_state) unless specified_state == "immediate" || specified_state.nil? || !@saved
@saved = @todo.save
@todo.update_state_from_project if @saved