thinking-sphinx icon indicating copy to clipboard operation
thinking-sphinx copied to clipboard

"can't convert nil into Hash" in Scopes

Open hotsen opened this issue 16 years ago • 4 comments

Hi,

thanks for fixing the search_count within scopes bug. I updated to the latest version. But now I experience another bug, which has been doing quite fine before ( the HEAD from two weeks ago)

When I use a String argument as the scope argument, e.g. (Video.with_status('foo').search 'bar')

it raises a

"can't convert nil into Hash" error in the active_record/scopes.rb line 52 thinking-sphinx/lib/thinking_sphinx/active_record/scopes.rb:57:in `merge!'

Doing some debugging, I found that the block.call(*args) resolves to nil, when *args is a String. This what not the case before the latest changes ...

Any ideas ?

Regards,

hotsen avatar Aug 25 '10 10:08 hotsen

Uuuh man. Sorry, my fault ... didn't noticed that I wasn't feeding in a String, instead its "id" ... "something".id .... :)

hotsen avatar Aug 25 '10 11:08 hotsen

Ah, so the bug no longer exists, then? :)

pat avatar Aug 28 '10 08:08 pat

Yeah, sure.

hotsen avatar Aug 30 '10 11:08 hotsen

cool, I'll close this ticket then.

pat avatar Sep 04 '10 14:09 pat