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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/soql_builder.rb +4 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5102bd01df0a350e928e8c4873716f75e100ec1cfe08eb21b0384e0a2c33c2e4
4
- data.tar.gz: 01f59d9e6b1a28dc28e23fe40f3edc9843254720fe7667ec27fcf4acae16b469
3
+ metadata.gz: f39b0685480107f7c3d34354068d72ba15692386577f25b915e3f28e2de4f4f7
4
+ data.tar.gz: 7263ee8cacd3e668f4d3a24610b752c1f8febda5ca92dc49fe354fe3db875ac1
5
5
  SHA512:
6
- metadata.gz: 3f291b31b62fc0b2569452bfc69aace985513d8d9bf3216e26f87ed48efd6819aefb066e4ec3dd950dccccac021ecd86aed9cf955d1dde42465345f4851b9d31
7
- data.tar.gz: 42a8007add11319de3bc397ba758da370734ac6cc27d18e1a7d1e047afbe1456da1ed8758856da0d9221e644a40678a6877fd37bf7ac0873ba46e1b2f54f68a9
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 += " #{structure_fields(@query[:fields])}" unless @query[:fields].empty?
51
- qs += ", (select #{ structure_fields(@query[:subquery][:fields]) } from #{ @query[:subquery][:object_table] })" unless @query[:subquery][:fields].empty?
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 structure_fields(fields)
58
- fields.map.with_index do |field, index|
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soql_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Avlonitis