Hey all, I have two models, in the first model Model1.search(nil) returns the metasearch builder as expected. for the the second model, the same search(nil) returns every object in the database (all 60k of them). This obviously isn''t what I want. I can''t seem to figure out what I did to the model to get it to behave this way, I have removed all of the code from the model itself and the behavior is still the same. Any tips/tricks/ideas would be very helpful. Thank you, Brian -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Mar 30, 2011 at 6:33 AM, PsiPro <arjesins-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey all, > > I have two models, in the first model > > Model1.search(nil) > > returns the metasearch builder as expected. > > for the the second model, the same search(nil) returns every object in > the database (all 60k of them). This obviously isn''t what I want. I > can''t seem to figure out what I did to the model to get it to behave > this way, I have removed all of the code from the model itself and the > behavior is still the same. >Can you paste in code pertinent to what you are doing? Sounds like is not the case but I would think that somewhere you are calling .all on the search if you are getting such a result.> > Any tips/tricks/ideas would be very helpful. > > Thank you, > Brian > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Can you paste in code pertinent to what you are doing? Sounds like is not > the case but I would think that somewhere you are calling .all on the search > if you are getting such a result.It looks like this issue to me (I posted in there as well) http://metautonomous.lighthouseapp.com/projects/53012/tickets/59-fetch-all-records-on-form-building And here is a barebones project I setup to create the same issue: https://github.com/arjes/meta_search_bug_possibly If it works in your environment (and isn''t a windows issue) you will notice that the return from Foo.search(nil) contains all the Foo records. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Eh nevermind... On Mar 30, 11:50 am, PsiPro <arjes...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Can you paste in code pertinent to what you are doing? Sounds like is not > > the case but I would think that somewhere you are calling .all on the search > > if you are getting such a result. > > It looks like this issue to me (I posted in there as well)http://metautonomous.lighthouseapp.com/projects/53012/tickets/59-fetc... > > And here is a barebones project I setup to create the same issue:https://github.com/arjes/meta_search_bug_possibly > > If it works in your environment (and isn''t a windows issue) you will > notice that the return from Foo.search(nil) contains all the Foo > records.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.