Validate done/weekly combination only on creation of task.

This commit is contained in:
Robert Waltemath 2013-06-24 09:49:06 +02:00
parent 577945e591
commit d081a2c66b

View file

@ -18,7 +18,7 @@ class Task < ActiveRecord::Base
validates :required_users, :presence => true validates :required_users, :presence => true
validates_numericality_of :duration, :required_users, :only_integer => true, :greater_than => 0 validates_numericality_of :duration, :required_users, :only_integer => true, :greater_than => 0
validates_length_of :description, maximum: 250 validates_length_of :description, maximum: 250
validates :done, exclusion: { in: [true], message: 'erledigte Aufgaben können nicht wöchentlich wiederholt werden' }, if: :periodic? validates :done, exclusion: { in: [true], message: 'erledigte Aufgaben können nicht wöchentlich wiederholt werden' }, if: :periodic?, on: :create
before_save :exclude_from_periodic_task_group before_save :exclude_from_periodic_task_group
after_save :update_ordergroup_stats after_save :update_ordergroup_stats