Class: EffortLogLineItem

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effort_log_line_item.rb

Instance Method Summary collapse

Instance Method Details

#determine_total_effortObject


11
12
13
14
15
16
17
18
19
20
# File 'app/models/effort_log_line_item.rb', line 11

def determine_total_effort
  self.sum = 0
  self.sum = self.sum + self.day1 if !self.day1.nil?
  self.sum = self.sum + self.day2 if !self.day2.nil?
  self.sum = self.sum + self.day3 if !self.day3.nil?
  self.sum = self.sum + self.day4 if !self.day4.nil?
  self.sum = self.sum + self.day5 if !self.day5.nil?
  self.sum = self.sum + self.day6 if !self.day6.nil?
  self.sum = self.sum + self.day7 if !self.day7.nil?
end