Class: ActiveRecord::Refined::AST::JsonLiteral
- Defined in:
- lib/active_record/refined/ast.rb
Overview
A Ruby value on the JSON side of a comparison, which jsonb and MySQL's JSON type answer alike: numbers compare as numbers and documents structurally. SQLite and MariaDB have only the text of each -- spelling and key order deciding what equality means -- and refuse here. PostgreSQL needs no cast, an untyped literal beside a jsonb operand coercing to jsonb; MySQL is told CAST(... AS JSON), since a bare string beside JSON would be a JSON string, and every string outranks every number in its ordering.
Instance Method Summary collapse
-
#initialize(value) ⇒ JsonLiteral
constructor
A new instance of JsonLiteral.
Methods inherited from Node
Constructor Details
#initialize(value) ⇒ JsonLiteral
Returns a new instance of JsonLiteral.
1091 1092 1093 |
# File 'lib/active_record/refined/ast.rb', line 1091 def initialize(value) @value = value end |