Module: Keymaker::Indexing::ClassMethods
- Defined in:
- lib/keymaker/indexing.rb
Instance Method Summary collapse
-
#index(index_name, options) ⇒ Object
index :threds, on: :name, with: :sanitized_name data structure: { threds: [{ :index_key => :name, :value => :sanitized_name }], users: [{ :index_key => :email, :value => :email }, { :index_key => :username, :value => :username }] }.
- #index_row(index_name) ⇒ Object
Instance Method Details
#index(index_name, options) ⇒ Object
index :threds, on: :name, with: :sanitized_name data structure: { threds: [{ :index_key => :name, :value => :sanitized_name }], users: [{ :index_key => :email, :value => :email }, { :index_key => :username, :value => :username }] }
18 19 20 |
# File 'lib/keymaker/indexing.rb', line 18 def index(index_name,) index_row(index_name.to_s) << { :index_key => [:on].to_s, :value => .fetch(:with, [:on]) } end |
#index_row(index_name) ⇒ Object
11 12 13 |
# File 'lib/keymaker/indexing.rb', line 11 def index_row(index_name) indices_traits[index_name] = indices_traits.fetch(index_name, []) end |