spyke 5.4.2 → 5.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spyke/relation.rb +5 -1
- data/lib/spyke/version.rb +1 -1
- data/test/scopes_test.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c76cac75e27368d88332f307ad042deb3038232fa0e01f9dd74064fce975fce9
|
4
|
+
data.tar.gz: 0bcb6c9dce2c00ae43800407d0f60593c30849a3649c1b4729baf07eb56877b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03efb5a7687d3ff25a72eaf0abcc8f3eb03b3035b1942bb02ea7b36eb14443ad3eb168483669df84764514d52a36ed79bfda3c9be770e54a7b09056cc9b075b4
|
7
|
+
data.tar.gz: b1927128da543354a1927ea2b38b09a7019331026751a2dc96b4dc2e1411073ebdac61f92b72bef40306a420dc08194ff74274b10b0b9e620699b8a2b38ca5a8
|
data/lib/spyke/relation.rb
CHANGED
@@ -5,7 +5,7 @@ module Spyke
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
7
|
attr_reader :klass
|
8
|
-
|
8
|
+
attr_reader :params
|
9
9
|
delegate :to_ary, :[], :any?, :empty?, :last, :size, :metadata, to: :find_some
|
10
10
|
|
11
11
|
def initialize(klass, options = {})
|
@@ -21,6 +21,10 @@ module Spyke
|
|
21
21
|
relation
|
22
22
|
end
|
23
23
|
|
24
|
+
def params=(params)
|
25
|
+
@params = params.symbolize_keys
|
26
|
+
end
|
27
|
+
|
24
28
|
def with(uri)
|
25
29
|
if uri.is_a? Symbol
|
26
30
|
@options[:uri] = File.join @options[:uri], uri.to_s
|
data/lib/spyke/version.rb
CHANGED
data/test/scopes_test.rb
CHANGED
@@ -61,6 +61,14 @@ module Spyke
|
|
61
61
|
assert_requested endpoint
|
62
62
|
end
|
63
63
|
|
64
|
+
def test_where_with_stringified_keys
|
65
|
+
endpoint = stub_request(:get, 'http://sushi.com/recipes/1/image')
|
66
|
+
|
67
|
+
RecipeImage.where("recipe_id" => 1).to_a
|
68
|
+
|
69
|
+
assert_requested endpoint
|
70
|
+
end
|
71
|
+
|
64
72
|
def test_chainable_class_method
|
65
73
|
endpoint = stub_request(:get, 'http://sushi.com/recipes?status=published&per_page=3')
|
66
74
|
|
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.4.
|
4
|
+
version: 5.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Balvig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|