Module: QuantumFields::Support::Mysql2
- Defined in:
- lib/quantum_fields/support/mysql2.rb
Overview
Abstracts MySQL support for quantum_fields operations
Class Method Summary collapse
-
.field_node(field, key) ⇒ Object
Returns an Arel node in the context of given field and JSON key, which in this context constructs as “json_extract(”my_models“.”my_json_field“, ‘$.key’)”.
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 “json_extract(”my_models“.”my_json_field“, ‘$.key’)”
10 11 12 13 14 |
# File 'lib/quantum_fields/support/mysql2.rb', line 10 def field_node(field, key) Arel::Nodes::NamedFunction.new('json_extract', [field, Arel::Nodes.build_quoted("$.#{key}")]) end |