find_by_sql(sql, binds = [])
Instance Public methods
Executes a custom SQL query against your database and returns all the
results. The results will be returned as an array with columns requested
encapsulated as attributes of the model you call this method from. If you
call Product.find_by_sql then the results will be returned in
a Product object with the attributes you specified in the SQL
query.
If you call a complicated SQL query which spans multiple tables the columns
specified