I have a Search Model which contains search data. It looks like this:
So basically what I want is, if one of the booleans is true it will
search that particular index. So if by_user is true and by_title is
true, it will search the database of stories by user and title. If
only by_user is true, then it will only search by user.
So here’s what I’m planning in the Search Model:
find(:all, :conditions => ??)
I’m confused has to how to make the conditions since it will have to
check which booleans are true and then append onto the conditions. How
would I do this?