leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
545 stars 214 forks source link

Calling .present? generates error #312

Closed davidwessman closed 8 years ago

davidwessman commented 8 years ago

Upgraded to version 3.6.2 and started getting errors in all places where I called:

grid = initialize_grid(Candidate.where(user: user, election: election), order: :created_at, include: [:position, :election])

Error generated by my controller spec where I call:

assigns(:grid).should be_present
ActiveRecord::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':joins=>nil, :include=>[:position, :election], :group=>nil}) FROM `candidates` WHERE' at line 1: SELECT COUNT({:joins=>nil, :include=>[:position, :election], :group=>nil}) FROM `candidates` WHERE `candidates`.`user_id` = 392 AND `candidates`.`election_id` = 73