This repository has been archived on 2021-11-24. You can view files and clone it, but cannot push or open issues or pull requests.
phone_app/app/models/i_task.rb
2021-08-23 10:26:02 +02:00

20 lines
341 B
Ruby

class ITask < ActiveRecord::Base
belongs_to :i_task_project
belongs_to :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