Class: Praxis::Extensions::AttributeFiltering::QuasiSqlLiteral
- Inherits:
-
Arel::Nodes::SqlLiteral
- Object
- Arel::Nodes::SqlLiteral
- Praxis::Extensions::AttributeFiltering::QuasiSqlLiteral
- Defined in:
- lib/praxis/extensions/attribute_filtering/active_record_filter_query_builder.rb
Overview
Helper class that can present an SqlLiteral string which we have already quoted … but! that can properly provide a “to_sym” that has the value unquoted This is necessary as (the latest AR code):
-
does not carry over “references” in joins if they are not SqlLiterals
-
but, at the same time, it indexes the references using the .to_sym value (which is really expected to be the normal string, without quotes)
If we pass a normal SqlLiteral, instead of our wrapper, without quoting the table, the current AR code will never quote it to form the SQL string, as it’s already a literal…so our “/” type separators as names won’t work without quoting.
Instance Method Summary collapse
-
#initialize(quoted:, symbolized:) ⇒ QuasiSqlLiteral
constructor
A new instance of QuasiSqlLiteral.
- #to_sym ⇒ Object
Constructor Details
#initialize(quoted:, symbolized:) ⇒ QuasiSqlLiteral
Returns a new instance of QuasiSqlLiteral.
16 17 18 19 |
# File 'lib/praxis/extensions/attribute_filtering/active_record_filter_query_builder.rb', line 16 def initialize(quoted:, symbolized:) @symbolized = symbolized super(quoted) end |
Instance Method Details
#to_sym ⇒ Object
21 22 23 |
# File 'lib/praxis/extensions/attribute_filtering/active_record_filter_query_builder.rb', line 21 def to_sym @symbolized end |