Module: DataMapper::Adapters::Sphinx::Resource
- Defined in:
- lib/dm-sphinx-adapter/resource.rb
Overview
Declare Sphinx indexes and attributes in your resource.
model Items
include DataMapper::SphinxResource
# .. normal properties and such for :default
repository(:search) do
# Query some_index, some_index_delta in that order.
index :some_index
index :some_index_delta, :delta => true
# Sortable by some attributes.
attribute :updated_at, DateTime # sql_attr_timestamp
attribute :age, Integer # sql_attr_uint
attribute :deleted, Boolean # sql_attr_bool
end
end
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(model) ⇒ Object
:nodoc:.
Class Method Details
.included(model) ⇒ Object
:nodoc:
24 25 26 27 28 29 |
# File 'lib/dm-sphinx-adapter/resource.rb', line 24 def self.included(model) #:nodoc: model.class_eval do include DataMapper::Resource extend ClassMethods end end |