I have a query problem with sqlite and MariaDB. In development I use sqlite but in server we use MariaDB. In development following query works
Author.includes(:books, employes: :universities).where("universities.id is ? and books.year is ?",
@author.employes.first.universities.first.id, @book.jahr).references(:employes, :books)
but in production this gives error. When I change is to =, it works in server but does not produce any result in local.
Author.includes(:books, employes: :universities).where("universities.id = ? and books.year = ?",
@author.employes.first.universities.first.id, @book.jahr).references(:employes, :books)
This works in server but no result is produced in local.
Edit What if I have something like this?
Author.includes(:books, employes: :universities).where("universities.id = ? and books.year = ? and employes.name like ? and id IN ?",
@author.employes.first.universities.first.id, @book.jahr, "%#{@employe.name}%", [1,2,3]).references(:employes, :books)