mincer 0.2.12 → 0.2.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99e788eed2040b91c303c0eb90c0edefb99b3d37
4
- data.tar.gz: b24f0318b5a6510fd208189f66d6ae3ae33b9383
3
+ metadata.gz: f8429e501c5e08d22afbc1b91d22e7679b36d8c8
4
+ data.tar.gz: 7ecdf9d3adbf364693382952c075477b59468795
5
5
  SHA512:
6
- metadata.gz: c87929d34fbc3b535d666be7786b7bc8e19ae393c1f295b7a1d973bfe9257eb4433dd1687601d75844bd7eb8938a78faee0d1e15d5e8fe5506270b93e112c772
7
- data.tar.gz: 1ea2edbcef8c41dae02301b60ece7b33480a4217f13dab58ef5680ab12f26ca94efb4b3b69af5ae616c735aff7c95f1aad6a4c3e01555729577b90be60507c7e
6
+ metadata.gz: c680f281b5e09e3269c8cdc1ff2bfadd2a55d559a4346c3fc4981c0cc6cada1956c54554bbf5c1c6e9e860b2a72be091b37a65e4f0a0eaa21d97ddd0520b2c9b
7
+ data.tar.gz: bd0d3055705492811c242aaa3b7fcfc67f441eee140d80b70989ec11d66dd54bc709f91340bd75f7cf5db53fadaeca0314cb01766338086c85936a5b2c2fcdd9
@@ -14,7 +14,9 @@ module Mincer
14
14
  def to_json
15
15
  if dump_supported?
16
16
  result = Mincer.connection.execute(json_query).first['json']
17
- @options[:singularize] ? (result[1..-2].presence || '{}') : result
17
+ return result unless @options[:singularize]
18
+ return (result[1..-2].presence || '{}') unless @options[:root]
19
+ (result.sub('[', '').sub(/(])}$/, '}').presence || '{}')
18
20
  else
19
21
  warn 'To dump data to json with postgres you need to use postgres server version >= 9.2'
20
22
  end
@@ -1,7 +1,7 @@
1
1
  module Mincer
2
2
 
3
3
  def self.version
4
- Gem::Version.new '0.2.12'
4
+ Gem::Version.new '0.2.13'
5
5
  end
6
6
 
7
7
  module VERSION #:nodoc:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mincer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Krasinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-18 00:00:00.000000000 Z
11
+ date: 2017-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord