loquor 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/loquor/api_calls/index.rb +6 -2
- data/lib/loquor/version.rb +1 -1
- data/test/api_calls/index_test.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2235b851b596e4ab7c4c0647d0794dfb5a03ef83
|
4
|
+
data.tar.gz: b535cfaa4426ec6472657772f158a4b93fba0de1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a467f81421afdd64570918f3e6cdbd56a43abef9fe3304499b7bff96104279191347f9c123835d6f7e53a6fc2bf240658a9dab2263f929140c626f4be76509db
|
7
|
+
data.tar.gz: 5caac15616d535425ca1cee9930109612c15c361ee1f3dec8af1c29aa513411f0720644820aca38fda2468f313da104edeedd899ce963ce7ef13c93db206fde8
|
data/CHANGELOG.md
CHANGED
@@ -96,8 +96,12 @@ module Loquor
|
|
96
96
|
when String, Symbol, Numeric, Date, Time, DateTime
|
97
97
|
query_string << "#{key}=#{URI.encode(value.to_s)}"
|
98
98
|
when Array
|
99
|
-
value.
|
100
|
-
|
99
|
+
if value.empty?
|
100
|
+
query_string << "#{key}[]="
|
101
|
+
else
|
102
|
+
value.each do |v|
|
103
|
+
query_string << "#{key}[]=#{URI.encode(v.to_s)}"
|
104
|
+
end
|
101
105
|
end
|
102
106
|
when Hash
|
103
107
|
value.each do |k,v|
|
data/lib/loquor/version.rb
CHANGED
@@ -50,6 +50,12 @@ module Loquor
|
|
50
50
|
assert_equal({genre: 'Animation'}, searcher.criteria)
|
51
51
|
end
|
52
52
|
|
53
|
+
def test_where_sets_empty_hash_value_criteria
|
54
|
+
criteria = {genre: []}
|
55
|
+
searcher = ApiCall::Index.new(resource).where(criteria)
|
56
|
+
assert_equal({genre: []}, searcher.criteria)
|
57
|
+
end
|
58
|
+
|
53
59
|
def test_where_merges_criteria
|
54
60
|
criteria1 = {genre: 'Animation'}
|
55
61
|
criteria2 = {foobar: 'Cat'}
|
@@ -69,7 +75,12 @@ module Loquor
|
|
69
75
|
assert searcher.send(:generate_url).include? "?clauses[]=WHERE%201=1"
|
70
76
|
end
|
71
77
|
|
72
|
-
def
|
78
|
+
def test_where_gets_correct_url_with_empty_criteria_hash_value
|
79
|
+
searcher = ApiCall::Index.new(resource).where(ids: [])
|
80
|
+
assert searcher.send(:generate_url).include? "?ids[]="
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_where_gets_correct_url_with_criteria
|
73
84
|
searcher = ApiCall::Index.new(resource).where(name: 'Star Wars')
|
74
85
|
assert searcher.send(:generate_url).include? "?name=Star%20Wars"
|
75
86
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loquor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Walker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: filum
|