Class: RaceRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RaceRecord
- Defined in:
- app/models/race_record.rb
Instance Method Summary collapse
Instance Method Details
#elapsed_time ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/models/race_record.rb', line 14 def elapsed_time if s = read_attribute(:elapsed_time) s.to_timecode else "" end end |
#elapsed_time=(time) ⇒ Object
22 23 24 |
# File 'app/models/race_record.rb', line 22 def elapsed_time=(time) write_attribute(:elapsed_time, time.seconds) if time # numbers will pass through unchanged. strings will be timecode-parsed end |