Answer the question
In order to leave comments, you need to log in
How to set child table names in joins() in Rails?
Hello. Is it possible to somehow use pure Rails for order and select, without using string values and the name of the table and field?
@in.institution_order_products.joins( product: [:products_type] )
.select('products.name').order('products_types.priority')
Answer the question
In order to leave comments, you need to log in
Judging by the documentation and personal experience, it is impossible. Although if the name column is unique among the tables used, it should work.select(:name)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question