17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/hyperstack/rail_tie.rb', line 17
def auto_config=(on)
Rails.configuration.tap do |config|
if [:on, 'on', true].include?(on)
config.eager_load_paths += %W(#{config.root}/app/hyperstack/models)
config.eager_load_paths += %W(#{config.root}/app/hyperstack/models/concerns)
config.eager_load_paths += %W(#{config.root}/app/hyperstack/operations)
delete_first config.eager_load_paths, "#{config.root}/app/hyperstack"
unless Rails.env.production?
config.autoload_paths += %W(#{config.root}/app/hyperstack/models)
config.autoload_paths += %W(#{config.root}/app/hyperstack/models/concerns)
config.autoload_paths += %W(#{config.root}/app/hyperstack/operations)
delete_first config.autoload_paths, "#{config.root}/app/hyperstack"
end
config.assets.paths.unshift ::Rails.root.join('app', 'hyperstack').to_s
if Rails.const_defined? 'Hyperstack::Console'
config.assets.precompile += %w( hyper-console-client.css )
config.assets.precompile += %w( hyper-console-client.min.js )
config.assets.precompile += %w( action_cable.js ) if Rails.const_defined? 'ActionCable'
end
else
delete_first config.eager_load_paths, "#{config.root}/app/hyperstack/models"
delete_first config.eager_load_paths, "#{config.root}/app/hyperstack/models/concerns"
delete_first config.autoload_paths, "#{config.root}/app/hyperstack/models"
delete_first config.autoload_paths, "#{config.root}/app/hyperstack/models/concerns"
delete_first config.eager_load_paths, "#{config.root}/app/hyperstack/operations"
delete_first config.autoload_paths, "#{config.root}/app/hyperstack/operations"
delete_first config.assets.paths, ::Rails.root.join('app', 'hyperstack').to_s
end
end
super
end
|