Module: Coactive::Loader

Defined in:
lib/coactive/loader.rb

Class Method Summary collapse

Class Method Details

.call(paths) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/coactive/loader.rb', line 9

def call(paths)
  return unless defined?(Rails)
  return if Rails.application.config.eager_load || paths.blank?

  Array.wrap(paths).each do |path|
    unless loaded[path]
      load(path)
      loaded[path] = true
    end
  end
end