Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

TypeError: Cannot visit FalseClass when using .nil? #342

Open
qoyyim opened this issue Oct 17, 2014 · 3 comments
Open

TypeError: Cannot visit FalseClass when using .nil? #342

qoyyim opened this issue Oct 17, 2014 · 3 comments

Comments

@qoyyim
Copy link

qoyyim commented Oct 17, 2014

i have this query
where{((valid_from >= my{date}) | (valid_from.nil?)) & ((valid_to <= my{date}) | (valid_to.nil?))}

and when i run it it's got that error

@qoyyim
Copy link
Author

qoyyim commented Oct 17, 2014

umm i already found the "right" way to using it in squeel (using == nil)
but i already accustomed using .nil? and .present?

nb: btw i seen Your post in the blog
if You busy, don't have time to fix this
can You just give me pointer
how to patch it myself

@bigxiang
Copy link
Contributor

Not very easy, and I am not sure how necessary to add this feature. Maybe you could hack Squeel::Nodes::Stub in your application?

@fikriauliya
Copy link

fikriauliya commented Dec 14, 2016

Hi @qoyyim,

It is such a coincidence, we also encountered the same error on our Rails app. It happens after we cleaned up the code due to http://www.rubydoc.info/github/bbatsov/rubocop/Rubocop/Cop/Style/NilComparison which make this error appears (well, again).

We have reverted back the change. But out of curiosity, did you manage to find out why this happen? 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants