Closed catmando closed 7 years ago
class Foo < ActiveRecord::Base finder_method :random do # will accept params offset(rand(Thing.count)).first end end
on client:
Foo.random # returns a random Foo Foo.random! # returns the last random Foo, and gets a new one
easy brute force implementation
on client:
easy brute force implementation