Sha256: c58ccd15bafbbb2ba37636cbbaec9da13f460bcc196f1f8da3bfc1f20f17df99

Contents?: true

Size: 515 Bytes

Versions: 1

Compression:

Stored size: 515 Bytes

Contents

module DeviseOnesignal
    module DeviceHelper

        def current_device
            if cookies[:oneSignalUserId].nil?
                device = Device.new
                device.user = current_user if current_user
                device.onesignal_permission = cookies[:oneSignalUserPermission]
                device.last_used = Time.now
            else
                device = Device.find_by(onesignal_id: cookies[:oneSignalUserId])
            end
            device
        end

    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
devise-onesignal-2.0.1 lib/devise-onesignal/device_helper.rb