riak-ripple / ripple

A rich Ruby modeling layer for Riak, Basho's distributed database
Other
619 stars 152 forks source link

Doc indexes #245

Closed joedevivo closed 12 years ago

joedevivo commented 12 years ago

Added index method to Indexes::ClassMethods

Example:

class User
    include Ripple::Document

    property :firstname, String
    property :lastname, String

    index :fullname, String do
        "#{self.firstname} #{self.lastname}"
    end
end

Creates and persists a secondary index "fullname_bin" with the value as evaluated by the block.