Module: QuantumFields::Support::Postgresql

Defined in:
lib/quantum_fields/support/postgresql.rb

Overview

Abstracts PostgreSQL support for quantum_fields operations

Class Method Summary collapse

Class Method Details

.field_node(field, key) ⇒ Object

Returns an Arel node in the context of given field and JSON key, which in this context constructs as “‘my_json_field’->>‘my_key’”



10
11
12
13
14
# File 'lib/quantum_fields/support/postgresql.rb', line 10

def field_node(field, key)
  Arel::Nodes::InfixOperation.new('->>',
                                  field,
                                  Arel::Nodes.build_quoted(key))
end