arel 7.1.2 → 7.1.3

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: 2399144c676bc7f590c0204ea754fdf535a9d715
4
- data.tar.gz: 67a31fe3f14b215a6e2ca0be88c9f97a6450f424
3
+ metadata.gz: 60798bcc684ea3ced1a4f162f9949b5bab2e0970
4
+ data.tar.gz: 5c2c10c8903f1d6ea662e750069957f346389f7a
5
5
  SHA512:
6
- metadata.gz: ee16e1759920826871c7e9e61f858de0df42922bb43e827d769ff18525ff58b9af0cfda6e75a3df565f76d3cb7b1259efbc078fe5f3fa0269411eaf843459e1b
7
- data.tar.gz: 2a3858946bbe6efefdf9a0e759455386958c6d6aa07be1fcad05083c869c387c1bf888a1bfbc88a0e3693bdf674dd3d86a69632069631182952e76cb69954f0c
6
+ metadata.gz: 536f6c961442b0ac33e4a8da505dd40ce1ede1906ecace4c6768353fb7a8bc7bcb8761ad25dec3ca62a6e666c7d625497c331c10fd7cf71be049033367c60f82
7
+ data.tar.gz: d71eb8659cadc5bc8dbfe1631632a5c05e4356ac7ace6cb1db2456e35631eeeac6b341c5f853bd49100b84a1cb602aacda8f9450ff2063c34a2b7406c61799f8
@@ -1,3 +1,12 @@
1
+ === 7.1.3 / 2016-10-07
2
+
3
+ * bug fixes
4
+
5
+ * Remove union mapping as :binary node when performing DepthFirst enumeration
6
+ * Fix invalid BindParam output in Dot visitor
7
+ * Add Arel::Nodes::Casted to dot visitor
8
+ * Use Arel::Nodes::BindParam in Oracle visitor for queries using both LIMIT and OFFSET
9
+
1
10
  === 7.1.2 / 2016-09-13
2
11
 
3
12
  * bug fixes
@@ -21,7 +21,7 @@ require 'arel/delete_manager'
21
21
  require 'arel/nodes'
22
22
 
23
23
  module Arel
24
- VERSION = '7.1.2'
24
+ VERSION = '7.1.3'
25
25
 
26
26
  def self.sql raw_sql
27
27
  Arel::Nodes::SqlLiteral.new raw_sql
@@ -98,7 +98,6 @@ module Arel
98
98
  alias :visit_Arel_Nodes_Regexp :binary
99
99
  alias :visit_Arel_Nodes_RightOuterJoin :binary
100
100
  alias :visit_Arel_Nodes_TableAlias :binary
101
- alias :visit_Arel_Nodes_Union :binary
102
101
  alias :visit_Arel_Nodes_Values :binary
103
102
  alias :visit_Arel_Nodes_When :binary
104
103
 
@@ -155,6 +155,11 @@ module Arel
155
155
  visit_edge o, "name"
156
156
  end
157
157
 
158
+ def visit_Arel_Nodes_Casted o
159
+ visit_edge o, 'val'
160
+ visit_edge o, 'attribute'
161
+ end
162
+
158
163
  def visit_Arel_Attribute o
159
164
  visit_edge o, "relation"
160
165
  visit_edge o, "name"
@@ -204,7 +209,6 @@ module Arel
204
209
  alias :visit_NilClass :visit_String
205
210
  alias :visit_TrueClass :visit_String
206
211
  alias :visit_FalseClass :visit_String
207
- alias :visit_Arel_Nodes_BindParam :visit_String
208
212
  alias :visit_Integer :visit_String
209
213
  alias :visit_Fixnum :visit_String
210
214
  alias :visit_BigDecimal :visit_String
@@ -212,6 +216,8 @@ module Arel
212
216
  alias :visit_Symbol :visit_String
213
217
  alias :visit_Arel_Nodes_SqlLiteral :visit_String
214
218
 
219
+ def visit_Arel_Nodes_BindParam o; end
220
+
215
221
  def visit_Hash o
216
222
  o.each_with_index do |pair, i|
217
223
  edge("pair_#{i}") { visit pair }
@@ -26,11 +26,22 @@ module Arel
26
26
  FROM ("
27
27
 
28
28
  collector = super(o, collector)
29
- collector << ") raw_sql_
29
+
30
+ if offset.expr.is_a? Nodes::BindParam
31
+ offset_bind = nil
32
+ collector << ') raw_sql_ WHERE rownum <= ('
33
+ collector.add_bind(offset.expr) { |i| offset_bind = ":a#{i}" }
34
+ collector << ' + '
35
+ collector.add_bind(limit) { |i| ":a#{i}" }
36
+ collector << ") ) WHERE raw_rnum_ > #{offset_bind}"
37
+ return collector
38
+ else
39
+ collector << ") raw_sql_
30
40
  WHERE rownum <= #{offset.expr.to_i + limit}
31
41
  )
32
42
  WHERE "
33
- return visit(offset, collector)
43
+ return visit(offset, collector)
44
+ end
34
45
  end
35
46
 
36
47
  if o.limit
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.2
4
+ version: 7.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-09-13 00:00:00.000000000 Z
14
+ date: 2016-10-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: minitest