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.
- Host: GitHub
- URL: https://github.com/johnvuko/scope_order_random
- Owner: johnvuko
- Created: 2011-12-24T22:18:08.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-12-09T04:09:46.000Z (over 13 years ago)
- Last Synced: 2025-01-11T14:15:43.192Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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