Sha256: 637d93ed0f2609e8992df6b226ec842cc075bf2441191adeda09cdb9bff0f000

Contents?: true

Size: 557 Bytes

Versions: 4

Compression:

Stored size: 557 Bytes

Contents

module DeviseOnesignal
    module DeviceHelper

        def current_device
            if cookies[:oneSignalPlayerId].nil?
                device = Device.new
                device.onesignal_permission = cookies[:oneSignalPlayerPermission]
                device.owner = ApplicationController.try(:set_device_owner) || set_device_owner
                device.last_used = Time.now
            else
                device = Device.find_by onesignal_id: cookies[:oneSignalPlayerId]
            end
            device
        end

    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
devise-onesignal-3.1.2 lib/devise-onesignal/device_helper.rb
devise-onesignal-3.1.1 lib/devise-onesignal/device_helper.rb
devise-onesignal-3.1.0 lib/devise-onesignal/device_helper.rb
devise-onesignal-3.0.2 lib/devise-onesignal/device_helper.rb