Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (10 sloc) 220 Bytes
module FindRandom
def self.append_features(base)
def base.find_random
count = self.count
return nil if count == 0
offset = rand(count)
self.find(:first, :offset => offset)
end
end
end
Jump to Line
Something went wrong with that request. Please try again.