aboutsummaryrefslogtreecommitdiffstats
path: root/config/environments
diff options
context:
space:
mode:
Diffstat (limited to 'config/environments')
-rw-r--r--config/environments/development.rb14
-rw-r--r--config/environments/production.rb17
-rw-r--r--config/environments/test.rb5
3 files changed, 36 insertions, 0 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb
index a912dd5de..dbf8d7b2a 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -32,4 +32,18 @@ Alaveteli::Application.configure do
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
+
+ # Do not compress assets
+ config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
+
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
+
+ # Log the query plan for queries taking more than this (works
+ # with SQLite, MySQL, and PostgreSQL)
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
+
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 0c1929366..a3e3cebd2 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -31,4 +31,21 @@ Alaveteli::Application.configure do
if AlaveteliConfiguration::force_ssl
config.middleware.insert_before ActionDispatch::Cookies, ::Rack::SSL
end
+
+ # Compress JavaScripts and CSS
+ config.assets.compress = true
+
+ # Choose the compressors to use
+ # config.assets.js_compressor = :uglifier
+ # config.assets.css_compressor = :yui
+
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs.
+ config.assets.digest = true
+
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+ # config.assets.precompile += %w( search.js )
+
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index df39e8873..97c2d4f7c 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -24,4 +24,9 @@ Alaveteli::Application.configure do
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
+ if !AlaveteliConfiguration.exception_notifications_from.blank? && !AlaveteliConfiguration.exception_notifications_to.blank?
+ middleware.use ExceptionNotifier,
+ :sender_address => AlaveteliConfiguration::exception_notifications_from,
+ :exception_recipients => AlaveteliConfiguration::exception_notifications_to
+ end
end