私は4をレールに私のプロジェクトをアップグレードしたが、MySQLはエラーを持っている:Railsの4:MySQLの2エラー
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 '=> nil OR delete_by < 1)) ORDER BY
t_dest_boardsのコード行で.
ID ASC LIMIT 1' at line 1: SELECT
t_dest_boards .* FROM
t_dest_boards WHERE (m_section_id = 1 AND v_employee_id = '02001' AND registration_date = '2017-02-13' AND (delete_by => nil OR delete_by < 1)) ORDER BY
t_dest_boards .
ID ASC LIMIT 1
:の右の方法かもしれない何
tdest_tmp = TDestBoard.where("m_section_id = ? AND v_employee_id = ? AND registration_date = ? AND (delete_by => nil OR delete_by < ?)", primary_section.m_section_id, params[:id], params[:tdaily_dates]["#{id}"], 1).first
Rails 4でこれをやっていますか?前もって感謝します!
'delete_by => nilまたはdelete_by <1'は、この条件をクエリで2回確認でき、' nil'は何ですか? –