soql_builder 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soql_builder.rb +4 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f39b0685480107f7c3d34354068d72ba15692386577f25b915e3f28e2de4f4f7
|
4
|
+
data.tar.gz: 7263ee8cacd3e668f4d3a24610b752c1f8febda5ca92dc49fe354fe3db875ac1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4839627d81a29083c1652c5719c5d12fecd6f779ea610578a9632435d248b17acc6c54d0889c6cab21a583c7ebf64d0de5528940d108de85ba6adfc8ddd8dfad
|
7
|
+
data.tar.gz: 274be243536bb5a2610765ce097fa901947d7aed44022223460eb3038e85c6905f7bef159c2c1abac8223c4fe02a75dadb3b23f7310b0f06b77df6c53ffa34d4
|
data/lib/soql_builder.rb
CHANGED
@@ -47,17 +47,14 @@ class SoqlBuilder
|
|
47
47
|
|
48
48
|
def structure_query
|
49
49
|
qs = @query[:type]
|
50
|
-
qs += " #{
|
51
|
-
qs += ", (select #{
|
50
|
+
qs += " #{join_fields(@query[:fields])}" unless @query[:fields].empty?
|
51
|
+
qs += ", (select #{ join_fields(@query[:subquery][:fields]) } from #{ @query[:subquery][:object_table] })" unless @query[:subquery][:fields].empty?
|
52
52
|
qs += " from #{@query[:object_table]}"
|
53
53
|
qs += " where #{@query[:where]}" unless @query[:where] == ''
|
54
54
|
qs
|
55
55
|
end
|
56
56
|
|
57
|
-
def
|
58
|
-
fields.
|
59
|
-
field << ',' unless fields.length - 1 == index
|
60
|
-
field
|
61
|
-
end.join(' ')
|
57
|
+
def join_fields(fields)
|
58
|
+
fields.join(', ')
|
62
59
|
end
|
63
60
|
end
|