Fix task validation #16
This commit is contained in:
parent
95efe554fc
commit
e561ddb064
2 changed files with 3 additions and 4 deletions
|
@ -17,8 +17,7 @@ class TasksController < ApplicationController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@task = Task.new(params[:task])
|
@task = Task.new(params[:task])
|
||||||
if @task.errors.empty?
|
if @task.save
|
||||||
@task.save
|
|
||||||
flash[:notice] = "Aufgabe wurde erstellt"
|
flash[:notice] = "Aufgabe wurde erstellt"
|
||||||
if @task.workgroup
|
if @task.workgroup
|
||||||
redirect_to :action => "workgroup", :id => @task.workgroup
|
redirect_to :action => "workgroup", :id => @task.workgroup
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Task < ActiveRecord::Base
|
||||||
attr_protected :users
|
attr_protected :users
|
||||||
|
|
||||||
validates_length_of :name, :minimum => 3
|
validates_length_of :name, :minimum => 3
|
||||||
validates_numericality_of :duration, :required_users, :only_integer => true, :greater_than => 1
|
validates_numericality_of :duration, :required_users, :only_integer => true, :greater_than_or_equal_to => 1
|
||||||
|
|
||||||
after_save :update_ordergroup_stats
|
after_save :update_ordergroup_stats
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue