Revisions
-
kpumuk revised this gist
Jan 28, 2009 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,11 +5,9 @@ class ActiveRecord::Base def self.random find(rand(count)) rescue ActiveRecord::RecordNotFound retry end end -
mdarby created this gist
Jan 4, 2009 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # Usage: # >> User.random # => #<User login: ... class ActiveRecord::Base def self.random begin find(rand(count)) rescue ActiveRecord::RecordNotFound self.random end end end