Class: Combustion::Application

Inherits:
Rails::Application
  • Object
show all
Defined in:
lib/combustion/application.rb

Class Method Summary collapse

Class Method Details

.configure_for_combustionObject

Some settings we’re not sure if we want, so let’s not load them by default. Instead, wait for this method to be invoked (to get around load-order complications).



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
# File 'lib/combustion/application.rb', line 20

def self.configure_for_combustion
  config.root = File.expand_path File.join(Dir.pwd, Combustion.path)

  if defined?(ActiveRecord::Railtie) && ::ActiveRecord.constants.include?(:MassAssignmentSecurity)
    # Turn on ActiveRecord attribute whitelisting
    # This way the dummy app matches new rails apps re: this setting
    config.active_record.whitelist_attributes      = true
    config.active_record.mass_assignment_sanitizer = :strict
  end

  if defined?(ActionController::Railtie)
    config.action_dispatch.show_exceptions            = false
    config.action_controller.perform_caching          = false
    config.action_controller.allow_forgery_protection = false
  end

  if defined?(ActionMailer::Railtie)
    config.action_mailer.delivery_method     = :test
    config.action_mailer.default_url_options = {:host => 'www.example.com'}
  end

  if defined?(Sprockets)
    config.assets.enabled = true
  end
end