Module: Randumb::ActiveRecord::Base

Included in:
ActiveRecord::Base
Defined in:
lib/randumb/relation.rb

Overview

Instance Method Summary collapse

Instance Method Details

#order_by_rand(opts = {}) ⇒ Object



175
176
177
# File 'lib/randumb/relation.rb', line 175

def order_by_rand(opts = {})
  where(nil).order_by_rand(opts)
end

#order_by_rand_weighted(ranking_column, opts = {}) ⇒ Object



179
180
181
# File 'lib/randumb/relation.rb', line 179

def order_by_rand_weighted(ranking_column, opts={})
  where(nil).order_by_rand_weighted(ranking_column, opts)
end

#random(max_items = nil, opts = {}) ⇒ Object



163
164
165
# File 'lib/randumb/relation.rb', line 163

def random(max_items = nil, opts = {})
  where(nil).random(max_items, opts)
end

#random_by_id_shuffle(max_items = nil, opts = {}) ⇒ Object



171
172
173
# File 'lib/randumb/relation.rb', line 171

def random_by_id_shuffle(max_items = nil, opts = {})
  where(nil).random_by_id_shuffle(max_items, opts)
end

#random_weighted(ranking_column, max_items = nil, opts = {}) ⇒ Object



167
168
169
# File 'lib/randumb/relation.rb', line 167

def random_weighted(ranking_column, max_items = nil, opts = {})
  where(nil).random_weighted(ranking_column, max_items, opts)
end