Class: DeviseMultipleTokenAuth::DeviceUpdateController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/devise_multiple_token_auth/device_update_controller.rb

Instance Method Summary collapse

Instance Method Details

#update_push_tokenObject



7
8
9
10
11
12
13
14
# File 'app/controllers/devise_multiple_token_auth/device_update_controller.rb', line 7

def update_push_token
  if @device.update(push_token_params)
    @device.cleanup_push_tokens!
    render json: @device
  else
    render json: {error: "Unable to update the device with those params"}, status: :unprocessable_entity
  end
end