I use elasticsearch-model and elasticsearch-rails gems in my rails project.
After searching, bunch of records are paginated and records method being called.
records = search_results.page(count).records
and when I got first record from records, for example, entity of Product class, and compare with class it returns false, but entity class is Product, why?
#returns Product entity
records.first
records.first.is_a?(Product) #=> false
records.first.class == Product #=> false
records.first.class.name #=> "Product"
I can compare with class.name == "Product", but why classes don't compare correctly?
EDIT: method records returns the collection of records from the database
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…