module NoBrainer::Document::Core

Attributes

_all[RW]

Public Class Methods

all(options={}) click to toggle source
# File lib/no_brainer/document/core.rb, line 24
def self.all(options={})
  (options[:types] || [:user]).map do |type|
    case type
    when :user
      Rails.application.eager_load! if defined?(Rails.application.eager_load!)
      _all
    when :nobrainer
      [NoBrainer::Document::Index::MetaStore, NoBrainer::Lock]
    when :system
      NoBrainer::System.constants
        .map { |c| NoBrainer::System.const_get(c) }
        .select { |m| m < NoBrainer::Document }
    end
  end.reduce([], &:+)
end