sunstone 5.0.0.4 → 5.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: ca2db5a6c3ea14865f367dbb2e47581ac78dcf5d
4
- data.tar.gz: 8c7c0ea51ded30b1b39fb09eee852989f588574f
3
+ metadata.gz: d651f0df180f9f4f42426026895a492473e6ebf4
4
+ data.tar.gz: f2c0d18b398b1b19d1cbaed650f77b3b9a57e47e
5
5
  SHA512:
6
- metadata.gz: 7fc4a0e6209543012c12f674a33b10c3a1a27a21e3bb6cc0a7f647f28a83490caddfe619546df1b86caf759504616588978ab42e7d1e65623f3c9d5a690089f5
7
- data.tar.gz: 33421456a4d97c91a606f250914a4b4c15ae889fee4ae33a6f08e13409b28fd10128edc9ca00cf482735169f28809587e7bc227b274f6f7874553260f7de73e6
6
+ metadata.gz: 3d4d17453a231b1547ba803d0f7728eeca34dffc567cbebc681ebba6fdcb2b23eb9e9a8a955e7b41531a0c45c414baacef543d7a8f450a1400a30a1207051aec
7
+ data.tar.gz: 64ab99ad6da7cceee959d694d3c4ba510c1f34303e03af5969f9c38d9edafc9ac5fd305c60150c3405d2f18aeee4e45e78434495fce9532bdcf77ca0499223ea
@@ -194,7 +194,7 @@ module Arel
194
194
  raise 'Upsupported'
195
195
  end
196
196
  if !collector.where.first['id']
197
- collector.table = collector.where.first.keys.first
197
+ collector.table = collector.where.first.keys.first if collector.is_a?(Arel::Collectors::Sunstone)
198
198
  collector.where[0] = {'id' => collector.where.first.values.first.values.first}
199
199
  end
200
200
 
@@ -628,7 +628,7 @@ module Arel
628
628
  #
629
629
  def visit_Arel_Nodes_JoinSource o, collector
630
630
  if o.left
631
- collector.table = o.left.name
631
+ collector.table = o.left.name if collector.is_a?(Arel::Collectors::Sunstone)
632
632
  end
633
633
  if o.right.any?
634
634
  # We need to visit the right to get remove bind values, but we don't
@@ -636,6 +636,7 @@ module Arel
636
636
  # collector << " " if o.left
637
637
  # collector = inject_join o.right, collector, ' '
638
638
  collector.join_source = inject_join(o.right, Arel::Collectors::Sunstone.new, ' ')
639
+ # collector.join_source = Arel::Visitors::PostgreSQL.new(Arel::Collectors::SQLString.new).send(:inject_join, o.right, Arel::Collectors::SQLString.new, ' ')
639
640
  end
640
641
  collector
641
642
  end
@@ -655,14 +656,12 @@ module Arel
655
656
  # def visit_Arel_Nodes_FullOuterJoin o
656
657
  # "FULL OUTER JOIN #{visit o.left} #{visit o.right}"
657
658
  # end
658
- #
659
- # def visit_Arel_Nodes_OuterJoin o, collector
660
- # collector << "LEFT OUTER JOIN "
661
- # collector = visit o.left, collector
662
- # collector << " "
663
- # visit o.right, collector
664
- # end
665
- #
659
+
660
+ def visit_Arel_Nodes_OuterJoin o, collector
661
+ collector = visit o.left, collector
662
+ visit o.right, collector
663
+ end
664
+
666
665
  # def visit_Arel_Nodes_RightOuterJoin o
667
666
  # "RIGHT OUTER JOIN #{visit o.left} #{visit o.right}"
668
667
  # end
@@ -687,10 +686,11 @@ module Arel
687
686
  #
688
687
  def visit_Arel_Table o, collector
689
688
  if o.table_alias
690
- collector << "#{o.name} #{o.table_alias}"
689
+ collector.table = o.table_alias if collector.is_a?(Arel::Collectors::Sunstone)
691
690
  else
692
- collector << o.name
691
+ collector.table = o.name if collector.is_a?(Arel::Collectors::Sunstone)
693
692
  end
693
+ collector
694
694
  end
695
695
 
696
696
  def visit_Arel_Nodes_In o, collector
@@ -898,7 +898,7 @@ module Arel
898
898
 
899
899
  def visit_Arel_Attributes_Attribute o, collector
900
900
  join_name = o.relation.table_alias || o.relation.name
901
- collector.table == join_name ? o.name : "#{join_name}.#{o.name}"
901
+ collector.table == join_name ? o.name : "#{join_name}.#{o.name}" if collector.is_a?(Arel::Collectors::Sunstone)
902
902
  end
903
903
  alias :visit_Arel_Attributes_Integer :visit_Arel_Attributes_Attribute
904
904
  alias :visit_Arel_Attributes_Float :visit_Arel_Attributes_Attribute
@@ -975,18 +975,14 @@ module Arel
975
975
  # collector << " "
976
976
  # visit thing, collector
977
977
  # end
978
- #
978
+
979
979
  def inject_join list, collector, join_str
980
980
  len = list.length - 1
981
981
  list.each_with_index.inject(collector) { |c, (x,i)|
982
- if i == len
983
- visit x, c
984
- else
985
- visit(x, c) << join_str
986
- end
982
+ visit x, c
987
983
  }
988
984
  end
989
- #
985
+
990
986
  # def infix_value o, collector, value
991
987
  # collector = visit o.left, collector
992
988
  # collector << value
@@ -998,7 +994,7 @@ module Arel
998
994
  if o.distinct
999
995
  collector << "DISTINCT "
1000
996
  end
1001
- collector = inject_join(o.expressions, collector, ", ") << ")"
997
+ collector = inject_join(o.expressions, Arel::Collectors::Sunstone.new, ", ")# << ")"
1002
998
  if o.alias
1003
999
  collector << " AS "
1004
1000
  visit o.alias, collector
@@ -1,3 +1,3 @@
1
1
  module Sunstone
2
- VERSION = '5.0.0.4'
2
+ VERSION = '5.0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunstone
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.4
4
+ version: 5.0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-30 00:00:00.000000000 Z
11
+ date: 2016-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -344,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
344
  version: '0'
345
345
  requirements: []
346
346
  rubyforge_project:
347
- rubygems_version: 2.5.1
347
+ rubygems_version: 2.6.4
348
348
  signing_key:
349
349
  specification_version: 4
350
350
  summary: A library for interacting with REST APIs