Why is Rails is adding `OR 1=0` to queries using the where clause hash syntax with a range?

后端 未结 5 941
生来不讨喜
生来不讨喜 2020-12-17 10:04

The project that I\'m working on is using MySQL on RDS (mysql2 gem specifically).

When I use a hash of conditions including a range in a where statement

5条回答
  •  臣服心动
    2020-12-17 10:29

    Check to see if you are using active_record-acts_as. That was the problem with me.

    Add the line below to your Gemfile:

    gem 'active_record-acts_as', :git => 'https://github.com/hzamani/active_record-acts_as.git'
    

    This will just pull the latest version of the Gem that will hopefully be fixed. Worked for me.

提交回复
热议问题