Class: KitIndexed
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- KitIndexed
show all
- Includes:
- Tire::Model::Callbacks, Tire::Model::Search
- Defined in:
- app/models/kit_indexed.rb
Direct Known Subclasses
Asset, Category, FormSubmission, Group, Help, Page, Snippet, Todo, TopicPost, TopicThread, User
Class Method Summary
collapse
Class Method Details
.do_indexing(model, index_definition) ⇒ Object
9
10
11
12
13
14
15
16
17
|
# File 'app/models/kit_indexed.rb', line 9
def self.do_indexing(model, index_definition)
$kit_indexes[model.to_sym] = index_definition
option_fields = [ :boost, :index, :as, :include_in_all, :type ]
index_definition.each do |ic|
options = {}
option_fields.collect { |f| options[f] = ic[f] if ic[f] }
indexes ic[:name], options
end
end
|
.indexed_columns(model) ⇒ Object
19
20
21
|
# File 'app/models/kit_indexed.rb', line 19
def self.indexed_columns(model)
$kit_indexes[model.to_sym]
end
|
.paginate(options = {}) ⇒ Object
23
24
25
|
# File 'app/models/kit_indexed.rb', line 23
def self.paginate(options = {})
page(options[:page]).per(options[:per_page])
end
|