Method: Babik::QuerySet::ProjectedField#sql
- Defined in:
- lib/babik/queryset/components/projection.rb
#sql ⇒ SQL
Return sql of the field to project. i.e. something like this:
<table_alias>.<field>
<table_alias>.<field> AS <field_alias>
e.g.
users_0.first_name
posts_0.title AS post_title
113 114 115 |
# File 'lib/babik/queryset/components/projection.rb', line 113 def sql "#{@selection.target_alias}.#{@selection.selected_field} AS #{@alias}" end |