torque-postgresql 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/torque/postgresql/auxiliary_statement.rb +3 -3
- data/lib/torque/postgresql/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: 77d019513db5d70b25fd3489ccbdd7305a11e2ab
|
4
|
+
data.tar.gz: d12c174d8466de76823f6fb80872bf3fc7303fec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 983236df47590d03edd4d0359e7782e10e4e469631f4f92f8808e6c9770d56e886be78d6d35711005d5761a5868ba2123a9fe98200f20f7915692aacacb7b97a
|
7
|
+
data.tar.gz: 2466995358d6b044ba9af43c52b26bdd861c725ade78dc696ea81283121d17d8efc28feae9098bdfe75dd3c09e3488a56d25f075194aa5f746534f2f42398407
|
@@ -169,9 +169,9 @@ module Torque
|
|
169
169
|
if query.columns_hash.key?(foreign_key)
|
170
170
|
joins_projections(base.primary_key => foreign_key)
|
171
171
|
if polymorphic.present?
|
172
|
-
foreign_type =
|
173
|
-
@selected_attributes << foreign_type
|
174
|
-
@join_attributes << foreign_type.eq(base_name)
|
172
|
+
foreign_type = foreign_key.gsub(/_id$/, '_type')
|
173
|
+
@selected_attributes << project(foreign_type, query_table)
|
174
|
+
@join_attributes << project(foreign_type).eq(base_name)
|
175
175
|
end
|
176
176
|
end
|
177
177
|
end
|