Module: Magic

Defined in:
lib/magic/presenter.rb,
lib/magic/presenter/base.rb,
lib/magic/presenter/engine.rb,
lib/magic/presenter/authors.rb,
lib/magic/presenter/helpers.rb,
lib/magic/presenter/version.rb,
lib/magic/presenter/global_id.rb,
lib/magic/presenter/test_case.rb,
app/models/concerns/magic/presentable.rb,
lib/generators/magic/presenter/generator.rb,
lib/generators/magic/presenter/install/install_generator.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Presentable, Presenter

Class Method Summary collapse

Class Method Details

.each_engineObject



36
37
38
39
40
41
# File 'lib/magic/presenter.rb', line 36

def each_engine(&)
	Rails.application
			.then { [ _1, *_1.railties ] }
			.grep(Rails::Engine)
			.each(&)
end

.eager_load(*scopes, engine: Rails.application) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/magic/presenter.rb', line 25

def eager_load *scopes, engine: Rails.application
	return if Rails.application.config.eager_load

	scopes
			.map(&:to_s)
			.map(&:pluralize)
			.map { engine.root / 'app' / _1 }
			.select(&:exist?)
			.each { Rails.autoloaders.main.eager_load_dir _1 }
end