Re: conditional filters on a sequel model

2008-02-06 Thread keeran
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

Re: conditional filters on a sequel model

2008-02-06 Thread keeran
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,

Re: conditional filters on a sequel model

2008-02-06 Thread Aman Gupta
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 =