Class: Bitcharts::ApplicationController
- Inherits:
-
Object
- Object
- Bitcharts::ApplicationController
- Defined in:
- app/controllers/bitcharts/application_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#files ⇒ Object
16 17 18 |
# File 'app/controllers/bitcharts/application_controller.rb', line 16 def files load_paths.flatten.compact.uniq.flat_map{ |path| Dir["#{path}/**/*.rb"] } end |
#load_charts ⇒ Object
9 10 11 12 13 14 |
# File 'app/controllers/bitcharts/application_controller.rb', line 9 def load_charts unless loaded? files.each{ |file| require_dependency(file) } @@loaded = true end end |
#load_paths ⇒ Object
5 6 7 |
# File 'app/controllers/bitcharts/application_controller.rb', line 5 def load_paths [File.('app/charts', Rails.root)] end |
#loaded? ⇒ Boolean
20 21 22 |
# File 'app/controllers/bitcharts/application_controller.rb', line 20 def loaded? Rails.configuration.eager_load || (@@loaded ||= false) end |