module TwoFactorDevices::Extensions::TwoFactorDeviceble

model extension for device's owner AR class

Public Instance Methods

primary_two_factor_device() click to toggle source
# File lib/two_factor_devices/extensions/two_factor_deviceble.rb, line 15
def primary_two_factor_device
  @primary_two_factor_device ||= two_factor_devices.confirmed.default.first ||
                                 two_factor_devices.confirmed.order(:id).first
end