dre 0.0.3 → 0.0.4

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: aaaa75fdb152a349ffb05e012ecd12bd238d40f2
4
- data.tar.gz: aaced50bfebd0298d4e4e34d3c74401d15d4573c
3
+ metadata.gz: 417bd06fed3bd4350d940fb704b06528f9718dc9
4
+ data.tar.gz: 67ba09cce7e7368dfa801a54da35fcf06b0c8e3e
5
5
  SHA512:
6
- metadata.gz: 33c22329664de9788920136bc5bf27ac17e1260e43101828dcce5744fb3d396143ae3f8cb9ceb4ebda3224a64c8e90116b1a4b8d8fb30ef9275fc88646711588
7
- data.tar.gz: c6146b863eea07f5c3c84527ebbf9209bb8e8d7731f69be1d36c87d38fe06cfdf87c91e289670aa4d16485dfccbc2b3b1d20110cff5cd9147957fed840fcbd40
6
+ metadata.gz: 141f451feb94f305b8c77c43d3f703810a3c8dbace980d0f78da1a0d218e62097c4c15a117fb4a2fe37832fc7a802bda3f6b2f5761b1c81c913c5947dc5728fa
7
+ data.tar.gz: 5b9ae0cefdf6a16c8b95ce318c794160c895315a00e3a982f8f207ed025b4c443a4b57f70e017f9a924c75ffc521c38faea2eb0b2752e888934c448c6f18eafd
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  begin
2
2
  require 'bundler/setup'
3
+ require 'appraisal'
3
4
  rescue LoadError
4
5
  puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
6
  end
@@ -11,18 +11,18 @@ module Dre
11
11
  end
12
12
 
13
13
  def register
14
- @device = collection.find_by(token: params[:token]) || Device.new(owner: user, token: params[:token])
14
+ @device = collection.where(token: params[:token]).first || Device.new(owner: user, token: params[:token])
15
15
  response = @device.persisted? ? 200 : 201
16
16
 
17
17
  if @device.save
18
- render json: { device: @device }, status: response
18
+ render json: { device: @device }, root: false, status: response
19
19
  else
20
20
  render json: { errors: @device.errors }, status: :unprocessable_entity
21
21
  end
22
22
  end
23
23
 
24
24
  def deregister
25
- @device = collection.find_by(token: params[:token])
25
+ @device = collection.where(token: params[:token]).first
26
26
 
27
27
  if @device.nil?
28
28
  render nothing: true, status: :not_found
@@ -15,7 +15,7 @@ module Dre
15
15
  private
16
16
 
17
17
  def invalidate_used_token
18
- Device.where(token: token).where.not(id: id).delete_all
18
+ Device.where(token: token).where('id != ?', id).delete_all
19
19
  end
20
20
 
21
21
  class << self
@@ -1,3 +1,3 @@
1
1
  module Dre
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dre
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Ivanopoulos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-25 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '3.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: '3.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: responders
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: appraisal
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: An engine to easily add in a Device model and registration / deregistration
98
112
  system by supplying a token provided mobile applications. Provides easy associations
99
113
  to device owner models.