public
Description: A Rails plugin that allows quick and easy fetching of random records, or records in random order.
Homepage: http://daniel.collectiveidea.com/blog/tags/random_finders
Clone URL: git://github.com/collectiveidea/random_finders.git
Search Repo:
Click here to lend your support to: random_finders and make a donation at www.pledgie.com !
name age message
folder MIT-LICENSE Wed Apr 25 14:08:00 -0700 2007 Initial testing of random_finders [danielmorrison]
folder README Thu May 17 11:40:48 -0700 2007 Updated readme and fixed a spelling error [danielmorrison]
folder Rakefile Wed Apr 25 14:08:00 -0700 2007 Initial testing of random_finders [danielmorrison]
folder init.rb Wed Apr 25 14:12:12 -0700 2007 require everything [danielmorrison]
folder lib/ Wed Jun 06 11:47:01 -0700 2007 Fixed silly typo, exposing lax test coverage [m... [danielmorrison]
folder tasks/ Wed Apr 25 14:08:00 -0700 2007 Initial testing of random_finders [danielmorrison]
folder test/ Wed Apr 25 14:08:00 -0700 2007 Initial testing of random_finders [danielmorrison]
README
RandomFinders
=============

Allows quick and easy fetching of random records, or records in random order.

Simply pass the :random to the order in any finder method.

Examples
========

Find a random article
  Article.find(:first, :order => :random)
  
Randomize photos
  Photo.find(:all, :order => :random)
  

Caveat
======

This will not treat you nicely with large datasets.  

Read about it here:
http://daniel.collectiveidea.com/blog/tags/random_finders



Based on an idea by Mike Burns
http://mikeburnscoder.wordpress.com/2006/08/18/retrieving-random-elements-from-an-activerecord/

Copyright (c) 2007 Daniel Morrison, Collective Idea (http://collectiveidea.com), released under the MIT license