我正在研究一个应用程序,该程序将跟踪用户的工作时间,然后从此数据生成图形...
考虑到他们可以在今天开始完成任何任务并完成它明天,我不能保存一个Date
... 现在,我保存整数字段,如hours
和整数minute
...
有没有一种方法(一些宝石,也许)来帮助我处理这种问题?
还是其他方法?
感谢处理“加工时间”
我班Atendimento
包含所有必要的数据
class Atendimento < ActiveRecord::Base
attr_accessible :horas, :minutos, :empresa, :tipo_atendimento, :observacao, :empresa_id, :tipoatendimento_id
belongs_to :empresa
belongs_to :tipo_atendimento, :foreign_key => 'tipoatendimento_id'
belongs_to :usuario
validates :horas, :minutos, presence: true
end
我不是很清楚......我不能这样做,因为当只有5个留下来结束分钟,用户可以启动任务的工作时间和另一天的任务继续......他甚至可以在今天开始任务,并在一周内完成任务 –