Class: Device

Inherits:
ApplicationRecord show all
Defined in:
app/models/device.rb

Instance Method Summary collapse

Instance Method Details

#alive?Boolean


9
10
11
12
# File 'app/models/device.rb', line 9

def alive?
  return true if last_actived_at.blank?
  (Date.current - last_actived_at.to_date).to_i <= 14
end

#platform_nameObject


14
15
16
# File 'app/models/device.rb', line 14

def platform_name
  @platform_name ||= I18n.t "device_platform.#{self.platform}"
end