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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bff1f7868f9525ae36d1a003c33422d12fea5e8e
4
- data.tar.gz: eb8cfbe4048d28e3b7097bad7f51d36e8fde1aa5
3
+ metadata.gz: 10f632d358dc01cd4a01250b5834f563fee086f4
4
+ data.tar.gz: 34ebd6d23f8d47d320bf002f9ec4b4ac8066a197
5
5
  SHA512:
6
- metadata.gz: 41d1fc61dcad51d35ac4feb6d46ff3cad2dd423ea39b1070b275f1cfd0a0a5f51279e10866e823a8ea4925f1d57fc42157b9bb3c10ad401acd8c688d300a5dcf
7
- data.tar.gz: fb7104cda38cc586278b0ac28ee1330ab1d97705e11bff14379d01f255d1fc12fadcded56b41d5b00cd236e630ad41f961dae7b35d1ff4adf73d5dcfc45ead6c
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->>#{@adapter.quote(key)}" }
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'superstore'
5
- s.version = '2.4.3'
5
+ s.version = '2.4.4'
6
6
  s.description = 'ActiveModel-based JSONB document store'
7
7
  s.summary = 'ActiveModel for JSONB documents'
8
8
  s.authors = ['Michael Koziarski', 'Infogroup']
@@ -7,6 +7,7 @@ end
7
7
  class Issue < Superstore::Base
8
8
  string :description
9
9
  string :title
10
+ json :comments
10
11
 
11
12
  before_create { self.description ||= 'funny' }
12
13
 
@@ -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: 'foo', description: 'bar'
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.3
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-11-23 00:00:00.000000000 Z
12
+ date: 2016-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel