This is a follow-up of d749227e87. This patch checks if the key `not_found` is present on the result object instead of calling `#blank?` on the model, as it can trigger an `ActiveRecord` relation.
d749227e87