arel-extensions 7.0.2 → 7.0.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
  SHA256:
3
- metadata.gz: cacc514c90f3c935c67e37ca4bc1e46ac2cd188a0aaa793b72cded82f5f683cf
4
- data.tar.gz: 26e637ca2a7db733f1689f06fd40cdd7766430d69d72a2e08c2eeeba57ad15aa
3
+ metadata.gz: c1a0a2f6ac5e4a3956f46fea9d82cf3771b71d73bef922c3c2cc84a2614684b7
4
+ data.tar.gz: bb688aea1ed1c5a146e0953a008024b43e6028b2e56e0717dd3573be97518f15
5
5
  SHA512:
6
- metadata.gz: 76985c31374664b54be3e43f26f16ad62e386dcf1c0930633e147488e5f689ff5e769ec6da087f38d8f713ce1c2dc137d01b01cc0eaf061a56fcb6868479d83e
7
- data.tar.gz: 6ee5df8149a3d8c152b9081ad06fcdab1b7135871c8787654d4a0c630e060d221dea7a31035f76c817494bd6ffc38e8d839a3296178dfdbb08c8666a1611878c
6
+ metadata.gz: b583428d45935c98ef0e3e7af8307b2367f5d382abd6c522d253e9d9692ba0d564853f7d364394536a59df6a3c946f78241608b4859a1c130079961e5707603f
7
+ data.tar.gz: 6d1dae094b8956f5b3a0518c4bed1a0fc4a4c46763b5f5bded4ad6ee7cfc79b2ad8dabf7062adc11b40d86d90be20cd48615cc6f31b957155734dc0efdac0123
@@ -1,5 +1,5 @@
1
1
  module Arel
2
2
  module Extensions
3
- VERSION = '7.0.2'
3
+ VERSION = '7.0.3'
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  require "arel"
2
2
  require File.expand_path('../nodes/binary_value', __FILE__)
3
+ require File.expand_path('../nodes/hex_encoded_binary_value', __FILE__)
3
4
 
4
5
  require_relative "./nodes/geometry"
5
6
  require_relative "./nodes/intersects"
@@ -0,0 +1,7 @@
1
+ module Arel
2
+ module Nodes
3
+ class HexEncodedBinaryValue < Arel::Nodes::Unary
4
+
5
+ end
6
+ end
7
+ end
@@ -145,6 +145,11 @@ module Arel
145
145
  collector
146
146
  end
147
147
 
148
+ def visit_Arel_Nodes_HexEncodedBinaryValue(o, collector)
149
+ collector << quote("\\x" + o.expr)
150
+ collector
151
+ end
152
+
148
153
  def visit_Arel_Nodes_Intersects o, collector
149
154
  visit(Arel::Nodes::NamedFunction.new('ST_Intersects', [ o.left, o.right ]), collector)
150
155
  collector
@@ -11,4 +11,13 @@ class BinaryValueTest < ActiveSupport::TestCase
11
11
  SQL
12
12
  end
13
13
 
14
+ test 'hex encoded binary value' do
15
+ query = Property.where( Arel::Nodes::HexEncodedBinaryValue.new("0101000000c04b9b84d02e3c400896a26e84252640") )
16
+
17
+ assert_equal(<<~SQL.gsub(/( +|\n)/, ' ').strip, query.to_sql)
18
+ SELECT "properties".* FROM "properties"
19
+ WHERE '\\x0101000000c04b9b84d02e3c400896a26e84252640'
20
+ SQL
21
+ end
22
+
14
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.2
4
+ version: 7.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
@@ -202,6 +202,7 @@ files:
202
202
  - lib/arel/nodes/has_any_key.rb
203
203
  - lib/arel/nodes/has_key.rb
204
204
  - lib/arel/nodes/has_keys.rb
205
+ - lib/arel/nodes/hex_encoded_binary_value.rb
205
206
  - lib/arel/nodes/intersects.rb
206
207
  - lib/arel/nodes/random.rb
207
208
  - lib/arel/nodes/relation.rb