Method: SpreeMobility::TranslationQuery#col_name

Defined in:
lib/spree_mobility/translation_query.rb

#col_name(attr) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/spree_mobility/translation_query.rb', line 16

def col_name(attr)
  select_columns = []
  fallback_locales.each do |locale|
    select_columns << "#{table_alias(locale)}.#{attr}"
  end
  "COALESCE(#{select_columns.join(',')})"
end