active_record-mti 0.0.2 → 0.0.3

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: 70e92bb458152badc92fe1d0f6aa3ac255419211
4
- data.tar.gz: ec759e61c4042d9fa8119f3c5602fa674b226260
3
+ metadata.gz: 775e9a363f5a8e4679c072bda8cb445a5de901ed
4
+ data.tar.gz: 0242e47c271bdeb7d17f6031262141f47d19db03
5
5
  SHA512:
6
- metadata.gz: 8156561ef762ff46a270d9907f1df24e74824fd4314a96ca365d30d03700cf92bc8e6a96c8f68f598680b98185fbbc2642900b2b32302303e81ceda50b596ba0
7
- data.tar.gz: 4d453baef7016ff52e81c366bb54bc8a095f35fce78186847ee605a2c2252810b258fb7e6f4e0e8bfc3be93d2623069802421cf4d0757e6f1267bf6a52002761
6
+ metadata.gz: 40c60c73d749220cfbb22a4992612f40e93ed0ea9fc6053ae95e4ba30fc43d6903d04721315fe4dd8b287728135ca8c8ce089b281a117954b0e493afcd356bd2
7
+ data.tar.gz: 091b6937861bf16fe0b41fcc7ab28e50aa9c58aca70d1e236c664109e4b4ee7e1361032ceac51e8c2a3b5616c64bb0970b319257b0ddd4d7a0f3ed1415741f16
@@ -27,9 +27,8 @@ module ActiveRecord
27
27
  column_alias ||= @klass.connection.column_name_for_operation(operation, select_value)
28
28
  relation.select_values = [select_value]
29
29
 
30
- # Only use the last projection (probably the COUNT(*)) all others don't matter
31
- # relation.arel.projections = [relation.arel.projections.last].compact if @klass.using_multi_table_inheritance?
32
- relation.arel.projections.shift if @klass.using_multi_table_inheritance?
30
+ # Remove our cast otherwise PSQL will insist that it be included in the GROUP
31
+ relation.arel.projections.select!{ |p| p.to_s != "cast(\"#{klass.table_name}\".\"tableoid\"::regclass as text)" } if @klass.using_multi_table_inheritance?
33
32
 
34
33
  query_builder = relation.arel
35
34
  bind_values = query_builder.bind_values + relation.bind_values
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module MTI
3
- VERSION = "0.0.2"
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record-mti
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Stevens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler