Class: Gehc::CustomerDevice

Inherits:
UserDevice show all
Defined in:
lib/models/gehc/customer_device.rb

Overview

GEHC Customer device

Constant Summary

Constants inherited from UserDevice

UserDevice::APPROVED, UserDevice::AUTHORIZING, UserDevice::DEREGISTERED, UserDevice::ENROLLING, UserDevice::KEEP_STATES, UserDevice::PENDING, UserDevice::REGISTERING, UserDevice::REJECTED, UserDevice::REMOVED, UserDevice::UNREGISTERED

Class Method Summary collapse

Methods inherited from UserDevice

#approved?, #search_fields

Methods included from Searchable

included

Class Method Details

.find_device_by(device_id) ⇒ Object

Find a user device by safely trying a number of approaches

  1. By ID

  2. By unique identifier

  3. By app47 identifier

  4. By token



17
18
19
20
21
# File 'lib/models/gehc/customer_device.rb', line 17

def self.find_device_by(device_id)
  super || Gehc::CustomerDevice.where(serialNumber: device_id).first
rescue StandardError
  nil
end