Class: Gaku::ExternalSchoolRecord

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

Instance Method Summary collapse

Instance Method Details

#attendance_rateObject



13
14
15
16
17
# File 'app/models/gaku/external_school_record.rb', line 13

def attendance_rate
  if units_values_present?
    (presence_days.to_f / total_units) * 100
  end
end

#presence_daysObject



19
20
21
# File 'app/models/gaku/external_school_record.rb', line 19

def presence_days
  total_units - units_absent if units_values_present?
end