Class: BriskBills::Initializer

Inherits:
Rails::Initializer
  • Object
show all
Defined in:
lib/brisk-bills/initializer.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(command = :process, configuration = Configuration.new) ⇒ Object



76
77
78
79
# File 'lib/brisk-bills/initializer.rb', line 76

def self.run(command = :process, configuration = Configuration.new)
  Rails.configuration = configuration
  super
end

Instance Method Details

#load_view_pathsObject



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/brisk-bills/initializer.rb', line 81

def load_view_paths
  view_paths = returning [] do |arr|
    # Add the singular view path if it's not in the list
    arr << configuration.view_path if !configuration.view_paths.include?(configuration.view_path)
    # Add the default view paths        
    arr.concat configuration.view_paths
  end

  if configuration.frameworks.include?(:action_controller) || defined?(ActionController::Base)
    view_paths.each do |vp|
      unless ActionController::Base.view_paths.include?(vp)
        ActionController::Base.prepend_view_path vp
      end
    end
  end      
end