mixpannenkoek 0.0.5 → 0.0.6
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/lib/mixpannenkoek/query.rb +2 -2
- data/lib/mixpannenkoek/version.rb +1 -1
- data/spec/lib/mixpannenkoek/query_spec.rb +7 -7
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f55c0ddc9a66498f2de2d3ffc1c2b1a2001548f
|
4
|
+
data.tar.gz: e37ed2b9b56527b2f70c17e589c9dcd14f292761
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac3e46bb52d9fb0d9fab474a244266796703f59886eec4ae7ee278a69474c3901f8bb74cfbd1fd7301b81ba684c7c2ed45564549bd3ea91b381e4dea63391333
|
7
|
+
data.tar.gz: 0cf8aa844402c82565e3e87ce15f25a9552ea753bbf87b9ad1d16df219540201875aa903e78d08b58a0a9539f95700f050a033faefa4cadcdee47d20d38246ba
|
data/lib/mixpannenkoek/query.rb
CHANGED
@@ -133,9 +133,9 @@ module Mixpannenkoek
|
|
133
133
|
|
134
134
|
case value
|
135
135
|
when Array
|
136
|
-
%Q((#{value.map { |val| %Q(properties["#{key}"] #{operator} "#{val}") }.join(" #{join} ")}))
|
136
|
+
%Q((#{value.map { |val| %Q(string(properties["#{key}"]) #{operator} "#{val}") }.join(" #{join} ")}))
|
137
137
|
else
|
138
|
-
%Q(properties["#{key}"] #{operator} "#{value}")
|
138
|
+
%Q(string(properties["#{key}"]) #{operator} "#{value}")
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
@@ -12,20 +12,20 @@ describe Mixpannenkoek::Base do
|
|
12
12
|
describe '#where' do
|
13
13
|
subject { Mixpannenkoek::TestQuery.where(date: date_range).where(subject_name: 'Subject ABC').request_parameters[1] }
|
14
14
|
it 'sets :where' do
|
15
|
-
expect(subject).to include({ where: 'properties["subject_name"] == "Subject ABC"' })
|
15
|
+
expect(subject).to include({ where: 'string(properties["subject_name"]) == "Subject ABC"' })
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'called twice' do
|
19
19
|
subject { Mixpannenkoek::TestQuery.where(date: date_range).where(subject_name: 'Subject ABC').where(training_name: 'Training XYZ').request_parameters[1] }
|
20
20
|
it 'sets multiple :where conditions' do
|
21
|
-
expect(subject).to include({ where: 'properties["subject_name"] == "Subject ABC" and properties["training_name"] == "Training XYZ"' })
|
21
|
+
expect(subject).to include({ where: 'string(properties["subject_name"]) == "Subject ABC" and string(properties["training_name"]) == "Training XYZ"' })
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
context 'called with value: []' do
|
26
26
|
subject { Mixpannenkoek::TestQuery.where(date: date_range).where(subject_name: ['Subject ABC', 'Subject XYZ']).request_parameters[1] }
|
27
27
|
it 'sets multiple :where conditions' do
|
28
|
-
expect(subject).to include({ where: '(properties["subject_name"] == "Subject ABC" or properties["subject_name"] == "Subject XYZ")' })
|
28
|
+
expect(subject).to include({ where: '(string(properties["subject_name"]) == "Subject ABC" or string(properties["subject_name"]) == "Subject XYZ")' })
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -60,20 +60,20 @@ describe Mixpannenkoek::Base do
|
|
60
60
|
describe '#where.not' do
|
61
61
|
subject { Mixpannenkoek::TestQuery.where(date: date_range).where.not(subject_name: 'Subject ABC').request_parameters[1] }
|
62
62
|
it 'sets :where' do
|
63
|
-
expect(subject).to include({ where: 'properties["subject_name"] != "Subject ABC"' })
|
63
|
+
expect(subject).to include({ where: 'string(properties["subject_name"]) != "Subject ABC"' })
|
64
64
|
end
|
65
65
|
|
66
66
|
context 'called twice' do
|
67
67
|
subject { Mixpannenkoek::TestQuery.where(date: date_range).where.not(subject_name: 'Subject ABC').where.not(training_name: 'Training XYZ').request_parameters[1] }
|
68
68
|
it 'sets multiple :where conditions' do
|
69
|
-
expect(subject).to include({ where: 'properties["subject_name"] != "Subject ABC" and properties["training_name"] != "Training XYZ"' })
|
69
|
+
expect(subject).to include({ where: 'string(properties["subject_name"]) != "Subject ABC" and string(properties["training_name"]) != "Training XYZ"' })
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
73
|
context 'called with value: []' do
|
74
74
|
subject { Mixpannenkoek::TestQuery.where(date: date_range).where.not(subject_name: ['Subject ABC', 'Subject XYZ']).request_parameters[1] }
|
75
75
|
it 'sets multiple :where conditions' do
|
76
|
-
expect(subject).to include({ where: '(properties["subject_name"] != "Subject ABC" and properties["subject_name"] != "Subject XYZ")' })
|
76
|
+
expect(subject).to include({ where: '(string(properties["subject_name"]) != "Subject ABC" and string(properties["subject_name"]) != "Subject XYZ")' })
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
@@ -151,7 +151,7 @@ describe Mixpannenkoek::Base do
|
|
151
151
|
|
152
152
|
subject { Mixpannenkoek::DefaultScopeQuery.where(date: date_range).request_parameters[1] }
|
153
153
|
it 'applies the default scope' do
|
154
|
-
expect(subject).to include({ where: 'properties["subject_name"] == "Subject XYZ"' })
|
154
|
+
expect(subject).to include({ where: 'string(properties["subject_name"]) == "Subject XYZ"' })
|
155
155
|
end
|
156
156
|
end
|
157
157
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixpannenkoek
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Kraan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixpanel_client
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.2.2
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Sugar for the mixpanel-client gem
|
@@ -133,3 +133,4 @@ test_files:
|
|
133
133
|
- spec/lib/mixpannenkoek/results_spec.rb
|
134
134
|
- spec/lib/mixpannenkoek_spec.rb
|
135
135
|
- spec/spec_helper.rb
|
136
|
+
has_rdoc:
|