Joe Peck
2009-Jun-29  14:55 UTC
undefined method ''new_search'' after upgrading SearchLogic
Hey,
I just upgraded from searchlogic-1.6.6 to searchlogic-2.1.1, and now
I''m
getting some new errors.
Previously, in the model I could have something like this:
def self.search(criteria, options={})
    criteria ||= {}
    search = self.new_search
 blah blah blah
end
and it would work.  Now, I''m getting this error whenever it tries to
call that method:
undefined method `new_search'' for #<Class:blahblah>
Anyone run into this before, or have ideas on how to resolve this?
Thankee in advance.
-- 
Posted via http://www.ruby-forum.com/.
senthil raja
2009-Jun-29  18:13 UTC
Re: undefined method ''new_search'' after upgrading SearchLogic
Hi joe I am facing pacing pagination problem with searchlogic logic gem. Do you have some related problem???? On Mon, Jun 29, 2009 at 8:25 PM, Joe Peck <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > Hey, > > I just upgraded from searchlogic-1.6.6 to searchlogic-2.1.1, and now I''m > getting some new errors. > > Previously, in the model I could have something like this: > > def self.search(criteria, options={}) > criteria ||= {} > > search = self.new_search > > blah blah blah > end > > and it would work. Now, I''m getting this error whenever it tries to > call that method: > undefined method `new_search'' for #<Class:blahblah> > > Anyone run into this before, or have ideas on how to resolve this? > Thankee in advance. > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Joe Peck
2009-Jun-29  18:17 UTC
Re: undefined method ''new_search'' after upgrading SearchLogic
senthil raja wrote:> Hi joe > > I am facing pacing pagination problem with searchlogic logic gem. Do you > have some related problem???? > > On Mon, Jun 29, 2009 at 8:25 PM, Joe PeckThe new SearchLogic gem doesn''t do pagination anymore. They recommend using will_paginate, which works pretty well for me. Hope that helps, Joe -- Posted via http://www.ruby-forum.com/.
Pablo Gonzalez
2009-Sep-05  18:55 UTC
Re: undefined method ''new_search'' after upgrading SearchLogic
I got the same problem:
undefined method `new_search''
I am using this code
    @busqueda1 = Establecimiento.new_search(
      :conditions =>{
         :titulo_or_descripcion_like_any => params[:busqueda].split
      },
      :per_page => per_page,
      :page => params[:page]
    )
    @establecimientos = @busqueda.all
I installed will_paginate and pagination does not cause error, but 
new_search method still doesn''t work.
Has anyone figured out how to solve it?
Joe Peck wrote:> Hey,
> 
> I just upgraded from searchlogic-1.6.6 to searchlogic-2.1.1, and now
I''m
> getting some new errors.
> 
> Previously, in the model I could have something like this:
> 
> def self.search(criteria, options={})
>     criteria ||= {}
> 
>     search = self.new_search
> 
>  blah blah blah
> end
> 
> and it would work.  Now, I''m getting this error whenever it tries
to
> call that method:
> undefined method `new_search'' for #<Class:blahblah>
> 
> Anyone run into this before, or have ideas on how to resolve this?
> Thankee in advance.
-- 
Posted via http://www.ruby-forum.com/.
Pablo Gonzalez
2009-Sep-06  15:15 UTC
Re: undefined method ''new_search'' after upgrading SearchLogic
Well while investigating about this issue I found that searchlogic v2 does not include that method anymore. It works in a diferent way. More info about this can be found at: http://www.binarylogic.com/2009/06/09/searchlogic-v2-beta-released/ http://github.com/binarylogic/searchlogic/tree/v2 In other words, that usage is deprecated as I underestood. The thing is I couldn''t find out how to use modificators of the previous version. Maybe writing your own name_scopes thought. Pablo Gonzalez wrote:> I got the same problem: > > undefined method `new_search'' > > I am using this code > > @busqueda1 = Establecimiento.new_search( > :conditions =>{ > :titulo_or_descripcion_like_any => params[:busqueda].split > }, > :per_page => per_page, > :page => params[:page] > ) > @establecimientos = @busqueda.all > > I installed will_paginate and pagination does not cause error, but > new_search method still doesn''t work. > > Has anyone figured out how to solve it? > > Joe Peck wrote: >> Hey, >> >> I just upgraded from searchlogic-1.6.6 to searchlogic-2.1.1, and now I''m >> getting some new errors. >> >> Previously, in the model I could have something like this: >> >> def self.search(criteria, options={}) >> criteria ||= {} >> >> search = self.new_search >> >> blah blah blah >> end >> >> and it would work. Now, I''m getting this error whenever it tries to >> call that method: >> undefined method `new_search'' for #<Class:blahblah> >> >> Anyone run into this before, or have ideas on how to resolve this? >> Thankee in advance.-- Posted via http://www.ruby-forum.com/.