Skip to content

Instantly share code, notes, and snippets.

@linyiru
Created September 15, 2008 03:25
Show Gist options
  • Save linyiru/10809 to your computer and use it in GitHub Desktop.
Save linyiru/10809 to your computer and use it in GitHub Desktop.
def self.find(*args)
if args.first.to_s == "random"
super(find(:first , :offset => (count * rand).to_i))
else
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment