An open API service indexing awesome lists of open source software.

https://github.com/johnvuko/scope_order_random

A plugin for implement order_random scope in your model.
https://github.com/johnvuko/scope_order_random

Last synced: 11 months ago
JSON representation

A plugin for implement order_random scope in your model.

Awesome Lists containing this project

README

          

scope_order_random
======================

A plugin for implement order_random scope in your model.
Use `order('RAND()')` for MySQL and `order('RANDOM()')` for other (supposed PostgreSQL or SQLite)

Installation
------------

Include the gem in your Gemfile:

gem 'scope_order_random', :git => 'https://github.com/jonathantribouharet/scope_order_random'

Usage
-----

User.order_random.first