superstore 2.4.3 → 2.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/superstore/adapters/jsonb_adapter.rb +1 -1
- data/superstore.gemspec +1 -1
- data/test/support/models.rb +1 -0
- data/test/unit/scope/query_methods_test.rb +3 -2
- 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: 10f632d358dc01cd4a01250b5834f563fee086f4
|
4
|
+
data.tar.gz: 34ebd6d23f8d47d320bf002f9ec4b4ac8066a197
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa43c12d476a6d7c2a66f51be01218d00374d91e992a73c019d0fc3a9248fda4a0aa2000d4ef52004b1e382331895f728eeb161a33ada001461e7a365bbfd19c
|
7
|
+
data.tar.gz: d01463ac21d6f220a773450122b1df2b920d5eae3af50608ef60ec6b95b1b5de79968dc6521af578c2fc04d1322db5e79e2b77643d1e654835522ba66b4f5420
|
@@ -30,7 +30,7 @@ module Superstore
|
|
30
30
|
elsif @scope.select_values == [@adapter.primary_key_column]
|
31
31
|
@adapter.primary_key_column
|
32
32
|
else
|
33
|
-
selects = @scope.select_values.map { |key| "#{@adapter.quote(key)},document
|
33
|
+
selects = @scope.select_values.map { |key| "#{@adapter.quote(key)},document->#{@adapter.quote(key)}" }
|
34
34
|
"#{@adapter.primary_key_column}, json_build_object(#{selects * ','}) as document"
|
35
35
|
end
|
36
36
|
end
|
data/superstore.gemspec
CHANGED
data/test/support/models.rb
CHANGED
@@ -2,10 +2,11 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class Superstore::Scope::QueryMethodsTest < Superstore::TestCase
|
4
4
|
test "select" do
|
5
|
-
original_issue = Issue.create title:
|
6
|
-
found_issue = Issue.select(:title).find(original_issue.id)
|
5
|
+
original_issue = Issue.create title: "foo", comments: [{"text" => "cool"}], description: 'bar'
|
6
|
+
found_issue = Issue.select(:title, :comments).find(original_issue.id)
|
7
7
|
|
8
8
|
assert_equal 'foo', found_issue.title
|
9
|
+
assert_equal [{"text" => "cool"}], found_issue.comments
|
9
10
|
assert_equal original_issue.id, found_issue.id
|
10
11
|
assert_nil found_issue.description
|
11
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Koziarski
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|