Class: ActiveRecord::Refined::AST::JsonHasKey

Inherits:
Predicate show all
Defined in:
lib/active_record/refined/ast.rb

Overview

Whether a key is in the document. PostgreSQL's spelling is the ? operator rather than jsonb_exists, the function it is shorthand for, because a GIN index matches the operator and never the function. A ? is a bind placeholder only to sanitize_sql, which none of the SQL written here passes through.

Instance Method Summary collapse

Methods included from Connectives

#!, #&, #|

Methods inherited from Node

#as, #asc, #collate, #desc

Constructor Details

#initialize(operand, key) ⇒ JsonHasKey

Returns a new instance of JsonHasKey.



1294
1295
1296
1297
# File 'lib/active_record/refined/ast.rb', line 1294

def initialize(operand, key)
  @operand = operand
  @key = key
end