Module: ActiveSupport::Dependencies

Defined in:
lib/mixable_engines.rb

Instance Method Summary collapse

Instance Method Details

#require_or_load(file_name, const_path = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/mixable_engines.rb', line 4

def require_or_load(file_name, const_path = nil)
  if file_name.starts_with?(Rails.root.to_s + '/app')
    relative_name = file_name.gsub(Rails.root.to_s, '')
    @engine_paths ||= plugin_and_engine_paths
    @engine_paths.each do |path|
      engine_file = File.join(path, relative_name)
      require_or_load_without_multiple(engine_file, const_path) if File.file?(engine_file)
    end
  end
  require_or_load_without_multiple(file_name, const_path)
end

#require_or_load_without_multipleObject



3
# File 'lib/mixable_engines.rb', line 3

alias_method :require_or_load_without_multiple, :require_or_load