spyke 5.3.1 → 5.3.2

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
  SHA256:
3
- metadata.gz: 3a8f605cd12c22641c85ffdaf643cead8ef8eab997e347075596a7b7c9149e0c
4
- data.tar.gz: 97caf4cac49eb5e66164193845e5a5bb60069cc910f349de38eaf01e0d7fd57c
3
+ metadata.gz: 7b4cc7a2c704c8dd15ed7c5aaa2f0f19e198643ea5ee5f91de7d5842da4b6c9b
4
+ data.tar.gz: 1b92e7a21d361198245a969be7e27635cafecfa17b3001649b0cb07d7f4ccc42
5
5
  SHA512:
6
- metadata.gz: 1afad1b576ca01dd62b642da238ad80f2048da50a73ca387ed8df541a005601ba55a2c4769c881e991f79d40adbfa0992377989881dc49ce12c58174265ffd36
7
- data.tar.gz: 6e99ad81b53c136acadb85bc5363510067cb7704bbdc74a8ad1c84c0b79ff0079ac5029e5aa6aa65b74e24446068d01e568fb4258080bdf4202ccb4c75303be9
6
+ metadata.gz: f8748c573657622a373d25a234a2fc628385601a4651f2ce7308aebf929909b0c4bd4eb06aa24ccf7378e3dd3fa469a9b598457b2faf0092646ffba2a257b2a3
7
+ data.tar.gz: 05f35ee6a8e7d11755c784c0903e83de0f970f4b071108048045c1570009a5cc514d7ea8121b8b26a125f24b06db08b5138a65e52899b61d4c0e8929351603d7
@@ -45,6 +45,10 @@ module Spyke
45
45
  use_setters(new_attributes) if new_attributes
46
46
  end
47
47
 
48
+ def id?
49
+ id.present?
50
+ end
51
+
48
52
  def id
49
53
  attributes[primary_key]
50
54
  end
data/lib/spyke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spyke
2
- VERSION = '5.3.1'
2
+ VERSION = '5.3.2'
3
3
  end
@@ -0,0 +1,11 @@
1
+ require 'test_helper'
2
+
3
+ module Spyke
4
+ class ConfigConnectionWarnTest < MiniTest::Test
5
+ def test_config_connection_warn
6
+ assert_output '', "[DEPRECATION] `Spyke::Config.connection=` is deprecated. Please use `Spyke::Base.connection=` instead.\n" do
7
+ Spyke::Config.connection = Spyke::Base.connection
8
+ end
9
+ end
10
+ end
11
+ end
data/test/orm_test.rb CHANGED
@@ -206,5 +206,13 @@ module Spyke
206
206
  assert_equal 1, user[:uuid]
207
207
  assert_equal 42, user[:id]
208
208
  end
209
+
210
+ def test_custom_primary_key_used_for_persistence_check
211
+ user = User.new
212
+ refute user.persisted?
213
+
214
+ user.uuid = 1
215
+ assert user.persisted?
216
+ end
209
217
  end
210
218
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spyke
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.1
4
+ version: 5.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-07 00:00:00.000000000 Z
11
+ date: 2018-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -288,6 +288,7 @@ files:
288
288
  - test/associations_test.rb
289
289
  - test/attributes_test.rb
290
290
  - test/callbacks_test.rb
291
+ - test/config_test.rb
291
292
  - test/custom_request_test.rb
292
293
  - test/fallbacks_test.rb
293
294
  - test/orm_test.rb
@@ -324,6 +325,7 @@ test_files:
324
325
  - test/associations_test.rb
325
326
  - test/attributes_test.rb
326
327
  - test/callbacks_test.rb
328
+ - test/config_test.rb
327
329
  - test/custom_request_test.rb
328
330
  - test/fallbacks_test.rb
329
331
  - test/orm_test.rb