undefined method `klass' for nil:NilClass
When using host filter 'applicable_errata_issued > "10 days ago"' , I get error "undefined method `klass' for nil:NilClass" in WebUI and attached traceback. Happens for both filtering hosts in hosts list and filtering hosts while generating templates.
Steps to Reproduce:
1. Monitoring -> Report Templates -> Host - Statuses -> Generate
2. hosts: applicable_errata_issued > "10 days ago"
Error, nothing generated
Successfully generated, correctly filtered report
This can also be generated via rails console
> Host.search_for('applicable_errata_issued = "10 days ago"') NoMethodError: undefined method `klass' for nil:NilClass from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/scoped_search-4.1.8/lib/scoped_search/query_builder.rb:398:in `reflection_keys'