Specify the SELECT and use the built in mechanism for the WHERE in Rails 3 -
is possible (rails 3) specify select part of rails query, , use regular in order write conditions?
something like:
model.find_by_sql("select blah blah table1 join table2 on...").where([conditions, params])
i think looking for:
model.select('table_name1.field1, table_name2.field2') .joins('join table_name2 on (table_name2.table_name1_id = table_name1.id)') .where([conditions, params])
Comments
Post a Comment