I know it's not safe to use interpolated strings when calling .where
.
e.g. this:
Client.where("orders_count = #{params[:orders]}")
should be rewritten as:
Client.where("orders_count = ?", params[:orders])
Is it safe to use interpolated strings when calling .order
? If not, how should the following be rewritten?
Client.order("#{some_value_1}, #{some_value_2}")
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…