Hi Jables,
There are no magic solution for what you''re trying to do.
What you can do is search each model and use a 4th model as the search
result.... using that search result model to paginate and display your
page.
This way you should be able to sort in different fashion as made the
query much more efficient.
One question I have for you is how do you trigger the search?
Regards,
Jean-Marc
http://m2i3.com
On Nov 9, 9:29 pm, Jables
<brun3...-Meo6Lv8EUjg3uPMLIKxrzw@public.gmane.org>
wrote:> Hey,
> I have three tables/models - stories, pictures, videos. I want to
> be able to search all of these at once to find entries within a date
> range. Currently I am searching each one and pushing the results onto
> an array which I paginate and display. This doesn''t work
correctly
> because it doesn''t sort correctly and seems like a poor solution.
>
> Additionally it would be helpful to be able to sort a date range and
> if that fails to find the 10 most recently added entries. This seems
> like a simple find but I''m not sure exactly how to do it.
>
> Thanks for any help.
> JB
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---