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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1a0a2f6ac5e4a3956f46fea9d82cf3771b71d73bef922c3c2cc84a2614684b7
|
4
|
+
data.tar.gz: bb688aea1ed1c5a146e0953a008024b43e6028b2e56e0717dd3573be97518f15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b583428d45935c98ef0e3e7af8307b2367f5d382abd6c522d253e9d9692ba0d564853f7d364394536a59df6a3c946f78241608b4859a1c130079961e5707603f
|
7
|
+
data.tar.gz: 6d1dae094b8956f5b3a0518c4bed1a0fc4a4c46763b5f5bded4ad6ee7cfc79b2ad8dabf7062adc11b40d86d90be20cd48615cc6f31b957155734dc0efdac0123
|
data/lib/arel/extensions.rb
CHANGED
@@ -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
|
data/test/binary_value_test.rb
CHANGED
@@ -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.
|
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
|