Nicolas Bally f20fe482c6 initial
2020-04-06 10:38:07 +02:00

21 lines
387 B
Ruby

class ITask < ActiveRecord::Base
belongs_to :i_task_project
belongs_to :admin
belongs_to :creator, :class_name => "Admin"
has_one :p_customer, :through => :i_website
validates :name, :presence => true
before_validation do
if !self.done
self.done_at = nil
elsif self.done and !self.done_at?
self.done_at = Time.now
end
end
end