Sha256: 8d10e0d78e155432786fc9da5b45262981b11c2bbcd046aff583e8a2a4b0020c

Contents?: true

Size: 738 Bytes

Versions: 1

Compression:

Stored size: 738 Bytes

Contents

ohm-sorted
==========

Sorted indexes for Ohm


Setup
-----

1. Include the `Callbacks` and `Sorted` modules in your model:

		include Ohm::Callbacks 
		include Ohm::Sorted

2. Add a sorted index to your model with the following line:

		sorted :status, by: :ranking

You will need to resave every model if they already exist.

Usage
-----

To query the sorted index, use the `sorted_find` class method.

    >> Post.sorted_find(:ranking, status: "draft")

This returns an Ohm::SortedSet, which is just a subclass of Ohm::BasicSet
backed by a sorted set.


Requirements
------------

This plugin works with Ohm versions higher than 0.1.3.


Acknowledgements
----------------

Many thanks to Damian Janowski (https://github.com/djanowski)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ohm-sorted-0.1.0 README.md