For some reason I can't use normal Ruby conditions within the block
I'm passing to Model.filter.
I.e. the following is falling over:
Post.filter do
if [EMAIL PROTECTED] use_title
:title.like [EMAIL PROTECTED]
end
end
It doesn't like multiple conditions AFAIK.
So i tried to get around
Thanks for the tip. I'm avoiding this approach as I have to combine
different filters depending on what's supplied, so I could potentially
have loads of permutations of the filter creation, which would be
ugly.
Unless of course you can keep adding to the same filter?
Kee
On Feb 6, 1:17 pm,
On Wed, Feb 6, 2008 at 6:01 AM, keeran [EMAIL PROTECTED] wrote:
Think I've found a solution, I didn't realise you could add additional
filters to an existing dataset...
So now I'm doing:
searchset = Model.filter {:enabled = true}
if some condition
searchset =