active_record-mti 0.0.4 → 0.0.5

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: e8cdbcbf3783467af40aaad29b0b016112319bec
4
- data.tar.gz: b00afc13f0a76d4514551e23484bd90f85034f99
3
+ metadata.gz: c6cc42809a8381152867f5083a0801180d2c8b59
4
+ data.tar.gz: 597fd1818b06313a94d2c8f4a704acf22874416a
5
5
  SHA512:
6
- metadata.gz: 1a35b8c190e745a86b4da18427d51f2c676e5aa0645ebd41c5de709ef6aa0fa74d133376130b17f7f55be8aa389e724668fca318c0f7ac1876fd24fbc5706bd6
7
- data.tar.gz: f1dce0c6e1750a27d1bb08bd905119468bdc8330a7589342fc7385c4a18fed57a7b8ed01593feb03ecae022bb3d272666a999e2d5c91719f33d19eb403a18dbb
6
+ metadata.gz: 54e156c3a04639e434793c4ff7bc39d185c887d428754ffb447111718428a1127261a4c49e49c554d7df437d1143c5bf96627da48eebe33e1b79e1c7e2942d4d
7
+ data.tar.gz: 051683cc7a617b3f96c0c285f39f5070919c9d92c7a020144020edf1d2c50d4c9b5e339c9e02fc3a5e294f5f37ebdc2997f507faa65d33a926837ebaca0d9510
@@ -81,9 +81,6 @@ module ActiveRecord
81
81
  # Postgresql doesn't like ORDER BY when there are no GROUP BY
82
82
  relation = unscope(:order)
83
83
 
84
- # Remove our cast otherwise PSQL will insist that it be included in the GROUP
85
- relation.arel.projections.select!{ |p| p.to_s != "cast(\"#{klass.table_name}\".\"tableoid\"::regclass as text)" } if @klass.using_multi_table_inheritance?
86
-
87
84
  column_alias = column_name
88
85
 
89
86
  bind_values = nil
@@ -103,6 +100,10 @@ module ActiveRecord
103
100
  column_alias ||= @klass.connection.column_name_for_operation(operation, select_value)
104
101
  relation.select_values = [select_value]
105
102
 
103
+ # Remove our cast otherwise PSQL will insist that it be included in the GROUP
104
+ # Somewhere between line 82 and 101 relation.arel.projections gets reset :/
105
+ relation.arel.projections.select!{ |p| p.to_s != "cast(\"#{klass.table_name}\".\"tableoid\"::regclass as text)" } if @klass.using_multi_table_inheritance?
106
+
106
107
  query_builder = relation.arel
107
108
  bind_values = query_builder.bind_values + relation.bind_values
108
109
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module MTI
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record-mti
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Stevens