Module: Randumb::ActiveRecord::Base
- Included in:
- ActiveRecord::Base
- Defined in:
- lib/randumb/relation.rb
Overview
Class methods
Instance Method Summary collapse
- #order_by_rand(opts = {}) ⇒ Object
- #order_by_rand_weighted(ranking_column, opts = {}) ⇒ Object
- #random(max_items = nil, opts = {}) ⇒ Object
- #random_by_id_shuffle(max_items = nil, opts = {}) ⇒ Object
- #random_weighted(ranking_column, max_items = nil, opts = {}) ⇒ Object
Instance Method Details
#order_by_rand(opts = {}) ⇒ Object
178 179 180 |
# File 'lib/randumb/relation.rb', line 178 def order_by_rand(opts={}) relation.order_by_rand(opts) end |
#order_by_rand_weighted(ranking_column, opts = {}) ⇒ Object
182 183 184 |
# File 'lib/randumb/relation.rb', line 182 def order_by_rand_weighted(ranking_column, opts={}) relation.order_by_rand_weighted(ranking_column, opts) end |
#random(max_items = nil, opts = {}) ⇒ Object
166 167 168 |
# File 'lib/randumb/relation.rb', line 166 def random(max_items = nil, opts = {}) relation.random(max_items, opts) end |
#random_by_id_shuffle(max_items = nil, opts = {}) ⇒ Object
174 175 176 |
# File 'lib/randumb/relation.rb', line 174 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
170 171 172 |
# File 'lib/randumb/relation.rb', line 170 def random_weighted(ranking_column, max_items = nil, opts = {}) relation.random_weighted(ranking_column, max_items, opts) end |