mincer 0.2.16 → 0.2.17

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: 8d1d887604bc5061bb53fb2caafbaa789eb69523
4
- data.tar.gz: 4fb0e9c8367666cf1f83e5193b3ed172f3cf9c8c
3
+ metadata.gz: 34a35780354d1a3d2c9850f6fa83996366c57485
4
+ data.tar.gz: 0e23085677d40f3a96560fd1bab2a90d16b03194
5
5
  SHA512:
6
- metadata.gz: 36f3e8f3c6b502d0e37a0952f44eb4d4c3f843191ce2e8aa36b4fbfba4b50e995a55f761f7c696e1261ae1e7d3e6249d957cbe76c4adfb14d7bd3041c598e950
7
- data.tar.gz: 8568e3abd658b9a114856601d25b2d58e02d961992ccbf09978dd480141e91f29eb5e4fd01a15611ed1576303b9fbd3830011b4c446bf91c676591680c2266dd
6
+ metadata.gz: add1d84d8e9595801b82e1c906baf72fb9fa33f684cf905927b6a26eaa2a97fef8267466291d4456ed2e285269ab5aca4c7388b85c4707e2b8063b01bf8187fb
7
+ data.tar.gz: 5bb7915aa9b8e816a543928f05a26878bd54e2477bea8af9f41560e6e14ef1afc0284bcfdeaba468e4c0961b8bd248746594ba9ac15b525c2922132a4aa9bb19
@@ -10,7 +10,7 @@ module Mincer
10
10
  end
11
11
 
12
12
  def self.postgres?
13
- self.connection.is_a?(::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) rescue false
13
+ self.connection.adapter_name == 'PostgreSQL' rescue false
14
14
  end
15
15
 
16
16
  def self.connection
@@ -13,7 +13,7 @@ module Mincer
13
13
 
14
14
  def to_json
15
15
  if dump_supported?
16
- result = Mincer.connection.execute(json_query).first['json']
16
+ result = Mincer.connection.select_all(json_query).first['json']
17
17
  return result unless @options[:singularize]
18
18
  return (result[1..-2].presence || '{}') unless @options[:root]
19
19
  (result.sub('[', '').sub(/(\])}$/, '}').presence || '{}')
@@ -1,7 +1,7 @@
1
1
  module Mincer
2
2
 
3
3
  def self.version
4
- Gem::Version.new '0.2.16'
4
+ Gem::Version.new '0.2.17'
5
5
  end
6
6
 
7
7
  module VERSION #:nodoc:
@@ -15,7 +15,7 @@ describe ::Mincer::Processors::PgJsonDumper::Processor do
15
15
 
16
16
  it 'dumps data via postgres' do
17
17
  query = subject.new(ActiveRecordModel)
18
- ActiveRecord::Base.connection.should_receive(:execute).and_call_original
18
+ ActiveRecord::Base.connection.should_receive(:select_all).and_call_original
19
19
  json_string = query.to_json
20
20
  json_string.should be_a(String)
21
21
  json_hash = JSON.parse(json_string)
@@ -29,7 +29,7 @@ describe ::Mincer::Processors::PgJsonDumper::Processor do
29
29
  context 'when root option is passed' do
30
30
  it 'puts responce inside under root key' do
31
31
  query = subject.new(ActiveRecordModel)
32
- ActiveRecord::Base.connection.should_receive(:execute).and_call_original
32
+ ActiveRecord::Base.connection.should_receive(:select_all).and_call_original
33
33
  json_string = query.to_json(root: 'items')
34
34
  json_string.should be_a(String)
35
35
  json_hash = JSON.parse(json_string)
@@ -56,7 +56,7 @@ describe ::Mincer::Processors::PgJsonDumper::Processor do
56
56
 
57
57
  it 'dumps data via calling super' do
58
58
  query = subject.new(ActiveRecordModel)
59
- ActiveRecord::Base.connection.should_not_receive(:execute)
59
+ ActiveRecord::Base.connection.should_not_receive(:select_all)
60
60
  json_string = query.to_json
61
61
  json_string.should be_nil
62
62
  end
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.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Krasinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2018-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord