Skip to content

Commit

Permalink
Merge branch 'fix-minus-remaining-time'
Browse files Browse the repository at this point in the history
  • Loading branch information
inside-hakumai committed Nov 16, 2018
2 parents d8e9753 + c9d7920 commit f2a3fdb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@ def self.calc_deadtime id
task = Task.all.find(id)
time = task.deadline - Time.zone.now
time / 60

if time < 0
time = 0
end

time
end

def self.calc_rate_busy id
d_time = calc_deadtime(id)
f_time = TaskController.calc_available_time id
f_time / d_time

if d_time <= 0
1
else
f_time = TaskController.calc_available_time id
f_time / d_time
end
end

def self.createRecord name, deadline, user_id=nil
Expand Down

0 comments on commit f2a3fdb

Please sign in to comment.