how do i dry this up

2 views
Skip to first unread message

adam

unread,
Jul 6, 2010, 7:46:27 AM7/6/10
to Searchlogic
hi all, im gettting to grips with authlogic and its great.

In one part of my app im using authlogic to create a timeline for my
users.
Unfortunately there are multiple valid sets of criteria so im
currently buiding up my array over several lines using searchlogic. Id
much rather be able to do a one liner with a few ORs.

here is a snippet

g...@gist.github.com:494f7e722c07abc1714c.git

2 things i dont like with this are

1) im sure this isnt good for db performance due to multiple calls
2) if i want to limit the results to 10 or order by created_at id have
to do this after fectching all the results using sort_by. Im sure if
I could use limit or acend_by_created_at tagged on the end of a one
liner would be more efficient.

The question is is it possible and if so how?



Reply all
Reply to author
Forward
0 new messages