Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added readme

  • Loading branch information...
commit eb9841bebe2f1fff305742540e1ab0e935431c56 1 parent b3bb815
Arkadiy Zabazhanov authored

Showing 2 changed files with 38 additions and 0 deletions. Show diff stats Hide diff stats

  1. 0  README
  2. +38 0 README.md
0  README
No changes.
38 README.md
Source Rendered
... ... @@ -0,0 +1,38 @@
  1 +# What?
  2 +
  3 +Mongoid::Orderable is a ordered list implementation for your mongoid models.
  4 +
  5 +# Why?
  6 +
  7 +* It uses native mongo batch increment feature
  8 +* It supports assignable api
  9 +* It proper assingns position while moving document between scopes
  10 +
  11 +# How?
  12 +
  13 +```
  14 +gem 'mongoid_orderable'
  15 +```
  16 +
  17 +Gem has the same api as others. Just include Mongoid::Orderable into your model.
  18 +Also you can initialize orderable manually and specify `:scope` or `:column` options:
  19 +
  20 +```
  21 +class Item
  22 + include Mongoid::Document
  23 + include Mongoid::Orderable
  24 +
  25 + # belongs_to :group
  26 +
  27 + # orderable :scope => :group, :column => :pos
  28 + # orderable :scope => lambda { |document| where(:group_id => document.group_id) }
  29 +end
  30 +```
  31 +
  32 +# Contributing
  33 +
  34 +Fork && Patch && Spec && Push && Pull request.
  35 +
  36 +# License
  37 +
  38 +Mongoid::Orderable is released under the MIT license.

0 comments on commit eb9841b

Please sign in to comment.
Something went wrong with that request. Please try again.