squeel icon indicating copy to clipboard operation
squeel copied to clipboard

like_any [] fails in Rails 4.2.1 with Ruby 2.2.1

Open codenamev opened this issue 9 years ago • 2 comments

Contact.where{ email.like_any([]) }.to_sql raises RuntimeError: unsupported: NilClass

I'd submit a pull if I knew where that code was, but I don't see any tests for like_any. Can someone point me to the right places?

codenamev avatar Apr 17 '15 18:04 codenamev

Have the same issue. Did you figure out how to solve it?

alejorivera avatar May 21 '15 01:05 alejorivera

Same issue here.

I fixed like this for now:

if list.empty?
Contact
.where("1 = 0")
else
Contact
.where{ email.like_any(list) }
end

I find the same issue closed here: #200

ProGM avatar Sep 08 '15 10:09 ProGM