app/models/tap_log_record.rb
# Return the Tap Log Record representing an activity during which this record occurred
Return the Tap Log Record representing an activity during which this record occurred
Return the Tap Log Record representing an activity during which this record occurred
def current_activity
    if self.entry_type == 'activity'
      self
    else
      self.user.tap_log_records.where('timestamp < ? AND entry_type = ?', self.timestamp, 'activity').order('timestamp desc').limit(1).first
    end
  end
def current_activity if self . entry_type == 'activity' self else self . user . tap_log_records . where ( 'timestamp < ? AND entry_type = ?' , self . timestamp , 'activity' ) . order ( 'timestamp desc' ) . limit ( 1 ) . first end end
Return the Tap Log Record representing an activity during which this record occurred
Return the Tap Log Record representing an activity during which this record occurred