mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 21:16:12 +02:00
25 lines
No EOL
486 B
Ruby
25 lines
No EOL
486 B
Ruby
require 'arel/nodes/binary'
|
|
require 'arel/predications'
|
|
require 'arel/visitors/postgresql'
|
|
|
|
module Arel
|
|
class Nodes::ContainsArray < Arel::Nodes::Binary
|
|
def operator
|
|
:"@>"
|
|
end
|
|
end
|
|
|
|
class Visitors::PostgreSQL
|
|
private
|
|
|
|
def visit_Arel_Nodes_ContainsArray(o, collector)
|
|
infix_value o, collector, ' @> '
|
|
end
|
|
end
|
|
|
|
module Predications
|
|
def contains_array(other)
|
|
Nodes::ContainsArray.new self, Nodes.build_quoted(other, self)
|
|
end
|
|
end
|
|
end |