SyntaxFix
Write A Post
Hire A Developer
Questions
ActiveRecord#where will return an ActiveRecord::Relation object (which will never be nil). Try using .empty? on the relation to test if it will return any records.