Module: Elastics::Result::DocumentLoader::ModelClasses
- Extended by:
- ModelClasses
- Included in:
- ModelClasses
- Defined in:
- lib/elastics/result/document_loader.rb
Instance Method Summary collapse
-
#map ⇒ Object
maps all the index/types to the ruby class.
Instance Method Details
#map ⇒ Object
maps all the index/types to the ruby class
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/elastics/result/document_loader.rb', line 17 def map @map ||= begin map = {} (Conf.elastics_models + Conf.elastics_active_models).each do |m| m = eval("::#{m}") if m.is_a?(String) indices = m.elastics.index.is_a?(Array) ? m.elastics.index : [m.elastics.index] types = m.elastics.type.is_a?(Array) ? m.elastics.type : [m.elastics.type] indices.each do |i| types.each { |t| map["#{i}/#{t}"] = m } end end map end end |