Module: Randumb::ActiveRecord::Base

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

Overview

Class methods

Instance Method Summary collapse

Instance Method Details

#order_by_rand(opts = {}) ⇒ Object



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

def order_by_rand(opts={})
  relation.order_by_rand(opts)
end

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



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

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

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



159
160
161
# File 'lib/randumb/relation.rb', line 159

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

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



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

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

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



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

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