I have a scope in Rails 5 that checks for the presence of a string value.
scope :category, ->(retro) {where retro: retro
if retro.present? }
Now when this scope is called and the param from user input passed is null, the sql query generated is
'SELECT * FROM categories WHERE categories.retro IS NULL'
How do I solve this?
nil, what is the expected behavior?