Require due_date for periodic tasks
This commit is contained in:
parent
d383288f4f
commit
36dd19f324
1 changed files with 1 additions and 0 deletions
|
@ -20,6 +20,7 @@ class Task < ActiveRecord::Base
|
||||||
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] }, if: :periodic?, on: :create
|
validates :done, exclusion: { in: [true] }, if: :periodic?, on: :create
|
||||||
|
validates_presence_of :due_date, if: :periodic?
|
||||||
|
|
||||||
before_save :exclude_from_periodic_task_group, if: :changed?, unless: :new_record?
|
before_save :exclude_from_periodic_task_group, if: :changed?, unless: :new_record?
|
||||||
after_save :update_ordergroup_stats
|
after_save :update_ordergroup_stats
|
||||||
|
|
Loading…
Reference in a new issue