active_record-mti 0.0.4 → 0.0.5
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 +4 -4
- data/lib/active_record/mti/calculations.rb +4 -3
- data/lib/active_record/mti/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6cc42809a8381152867f5083a0801180d2c8b59
|
4
|
+
data.tar.gz: 597fd1818b06313a94d2c8f4a704acf22874416a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|