Ruby on Rails Wednesday, January 16, 2013

On Tue, Jan 15, 2013 at 5:20 PM, Jean <josorioe@gmail.com> wrote:

> def self.advsearch(summary_description, specialties, place, study, course,
> language)
>
> end
>
> As you can imagine the parameters could be present all of them, none of them
> or some of them

I would advise you make each of them a single-item scope, and then
chain them together in this one. That will be the most modular and
flexible. On each one, you can test for whether the desired item is
present or not, before invoking the pg_search scope. See
http://www.slideshare.net/dare2xl/full-text-search-on-heroku-for-free
for more information

-Dave (who wrote that slide deck)

--
Dave Aronson, the T. Rex of Codosaurus LLC,
secret-cleared freelance software developer
taking contracts in or near NoVa or remote.
See information at http://www.Codosaur.us/.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment