#115 new

.search won't work

Reported by anatinus | November 16th, 2009 @ 02:50 PM

When I try to use .search from the console, (e.g. User.search(:login_like=>"bob") )I get the following error:

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.[]

    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/named_scope.rb:114:in `initialize'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/named_scope.rb:92:in `new'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/named_scope.rb:92:in `named_scope'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/named_scope.rb:96:in `call'
    from /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/named_scope.rb:96:in `scoped'
    from /usr/local/src/sldb/sldb_app/vendor/plugins/searchlogic/lib/searchlogic/search.rb:99:in `method_missing'
    from (irb):3

I'm running rails 2.2.2 and searchlogic gem version 2.3.5

However, User.login_like("bob") works fine.
Any idea why this might be?


No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket