searchlogic icon indicating copy to clipboard operation
searchlogic copied to clipboard

You have a nil object when you didn't expect it!

Open jmaniv opened this issue 15 years ago • 1 comments

I have install searchlogic then tried in ruby script/console

search=BankingDetail.search(:name_like_all=>"man") search.all

i got error when i call 'all' method

NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.[]

jmaniv avatar May 29 '10 06:05 jmaniv

i have the exact same issue. ie i write..

Product.search(:descr_equals => "test").all and it returns nil

while Product.descr_equals("test").all returns the collection as normal

Rails 2.3.8, Ruby 1.8.7

update: my bad, i had a named_scope in my model called :all which was empty ... :P

kotsaris avatar Jun 02 '10 13:06 kotsaris