I have a number of tags for each post. (Very similar to SO). I want 20 random items, non-repeating.
I know that I could use Tags.all.rand
(And repeat 10 times) however, this won't guarantee uniqueness.
And I know I could use a SQL Query but since my development environment use sqlite as the db and MySQL in production, ORDER by RAND
won't work for both.
Aside from having two different queries (Dev & Prod) what else can I do?
Thanks