devise_multiple_token_auth 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfdf2a4fdf2ea88294f52253a4575782f98e9d5b
4
- data.tar.gz: b663dfa01618f3d864474359c71bfe1dea1921d3
3
+ metadata.gz: 5b00f815325a2452000637f782bcca9703626fae
4
+ data.tar.gz: 420c1c6e8e8f284947f7d2ce76c704557f52402f
5
5
  SHA512:
6
- metadata.gz: fe177160078b141e20be91242e16c03dbfc7f067e9c1dfebbfb692d17dbc9d65e12a40aa880bcc7d2f8f702c34f867cdb7b71a2607879b868fe3ddd9862f4fa7
7
- data.tar.gz: 1acef4022584fea7fdb1dbcdf44a55c7e77fff7e30add74c37ebcb89fe2895cb9a20f407e0bbbb963c60360a53448a1978a949eaeb88212161fd924202ec1ec3
6
+ metadata.gz: 54cbb3c6e9ddbdd97e8246d8fd55e049226676ac7966bf9e843febbc6094a6fdbcc12e6c4ea4a26636020130556ba33aab4660f8298e653d598c2b0ed4b72dcb
7
+ data.tar.gz: 5656f0f6360459bd24c58326119b6049b41c2f39325f76ebf2708fc364a57173ecd1581781bf9c5b4a9de34be689dadecd5d1db9369f98916899614648135a13
@@ -6,7 +6,7 @@ class DeviseMultipleTokenAuth::DeviceUpdateController < ApplicationController
6
6
 
7
7
  def update_push_token
8
8
  if @device.update(push_token_params)
9
- DeviseMultipleTokenAuth::Device.cleanup_push_tokens(@device.push_token, @device)
9
+ @device.cleanup_push_tokens!
10
10
  render json: @device
11
11
  else
12
12
  render json: {error: "Unable to update the device with those params"}, status: :unprocessable_entity
@@ -8,8 +8,8 @@ class DeviseMultipleTokenAuth::Device < ActiveRecord::Base
8
8
  DeviseMultipleTokenAuth::Device.expired.destroy_all
9
9
  end
10
10
 
11
- def self.cleanup_push_tokens!(token,omit_device)
12
- Device.where.not(id:omit_device.id).where(push_token:token).each do |other_device|
11
+ def cleanup_push_tokens!
12
+ self.class.where.not(id:self.id).where(push_token:self.push_token).each do |other_device|
13
13
  other_device.push_token = nil
14
14
  other_device.save
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseMultipleTokenAuth
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_multiple_token_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Juncker