Fixed the checking for activerecord errors in tasks and impediments to check for errors.empty?

pull/6827/head
Sebastian Schuster 12 years ago
parent 05e9e67c22
commit b783cd2644
  1. 3
      app/controllers/rb_impediments_controller.rb
  2. 2
      app/controllers/rb_tasks_controller.rb

@ -3,8 +3,7 @@ class RbImpedimentsController < RbApplicationController
def create
@impediment = Impediment.create_with_relationships(params, @project.id)
result = @impediment.errors.length
status = (result == 0 ? 200 : 400)
status = (@impediment.errors.empty? ? 200 : 400)
@include_meta = true
respond_to do |format|

@ -4,7 +4,7 @@ class RbTasksController < RbApplicationController
def create
@task = Task.create_with_relationships(params, @project.id)
status = (@task.errors.none? ? 200 : 400)
status = (@task.errors.empty? ? 200 : 400)
@include_meta = true
respond_to do |format|

Loading…
Cancel
Save