Skip to content

Commit

Permalink
Fix deprecation warning of InstanceMethods.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlackty committed Jan 17, 2013
1 parent e222277 commit 6ccd2cd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/fast_random.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
require 'active_support/concern'
module FastRandom
extend ActiveSupport::Concern

module ClassMethods
def random
joins("join (SELECT CEIL(RAND() * (SELECT MAX(id) FROM #{table_name})) AS gid) AS r2").where("#{table_name}.id > r2.gid")
end
end

module InstanceMethods
end

end

end

0 comments on commit 6ccd2cd

Please sign in to comment.