Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add table name to search query (thoughtbot#830)
* Add table name to search query Problem: When default scopes with joins are used, the generated search query can lead to ambiguity. For instance, the column `id` may exist in two tables, which will lead to a SQL error when it is impossible to decide which table to use. Solution: Add `resource_class`'s `table_name` to the generated search query. This ensures that the generated query produces the format `table_name.id` instead of `id` in the where clause generated for the search. * Quote table and column name in search Closes thoughtbot#829
- Loading branch information