Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (49 sloc) 1.58 KB


Resolver is a flexible Redis-backed high performance index and cache solution for ActiveModel-like objects.


Assuming you already have Redis installed:

$ gem install resolver

Or add the gem to your Gemfile.

require 'resolver'
Resolver.redis = 'redis://.../'

If you are using Rails, add the above to an initializer. If Redis is running on localhost and on the default port the second line is not needed.

Example usage

class Post < ActiveRecord::Base
  include Resolver::Key

  key :category
  key :slug, :unique => true, :global => true


Post.create(:category => 'News', :slug => 'example-post')

Post.find_by(:slug, 'example-post')
Post.exists_with?(:slug, 'example-post') # => true
Post.count_with(:category, 'News') # => 1

The :global => true option means that the key globally namespaced and is shared by all models. If global is set to false the key is instead namespaced based on the name of the model class.


If you want to make your own changes to Resolver, first clone the repo and run the tests:

git clone git://
cd resolver
rake test

Remember to install the Redis server on your local machine.


Once you've made your great commits:

  1. Fork Resolver
  2. Create a topic branch - git checkout -b my_branch
  3. Push to your branch - git push origin my_branch
  4. Create a Pull Request from your branch
  5. That's it!


Resolver was created by Niklas Holmgren ( and released under the MIT license.