From 3c0bdff823f71b2843b5300957e05aac310ee7e6 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Thu, 10 Sep 2015 17:43:58 +0800 Subject: [PATCH] some config changes for rails 4 found on the Internet --- config/application.rb | 7 ------- config/environments/development.rb | 15 ++------------- config/environments/production.rb | 3 +++ config/environments/test.rb | 8 ++------ 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/config/application.rb b/config/application.rb index d9f5f0f1..37547b27 100644 --- a/config/application.rb +++ b/config/application.rb @@ -44,14 +44,7 @@ module Metamaps # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql - # Enforce whitelist mode for mass assignment. - # This will create an empty whitelist of attributes available for mass-assignment for all models - # in your app. As such, your models will need to explicitly whitelist or blacklist accessible - # parameters by using an attr_accessible or attr_protected declaration. - # config.active_record.whitelist_attributes = true - # Enable the asset pipeline - config.assets.enabled = true config.assets.initialize_on_precompile = false # Version of your assets, change this if you want to expire all your assets diff --git a/config/environments/development.rb b/config/environments/development.rb index 74431de7..251e12ab 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,14 +1,13 @@ Metamaps::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = false + # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false @@ -40,16 +39,6 @@ Metamaps::Application.configure do # Print deprecation notices to the Rails logger config.active_support.deprecation = :log - # Only use best-standards-support built into browsers - config.action_dispatch.best_standards_support = :builtin - - # 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 - # Do not compress assets config.assets.compress = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 2186327f..17773071 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,6 +1,9 @@ Metamaps::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = true + config.assets.js_compressor = :uglifier + # Code is not reloaded between requests config.cache_classes = true diff --git a/config/environments/test.rb b/config/environments/test.rb index 8a7b408c..18c17296 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,6 +1,8 @@ Metamaps::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = false + # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped @@ -11,9 +13,6 @@ Metamaps::Application.configure do config.serve_static_assets = true config.static_cache_control = "public, max-age=3600" - # Log error messages when you accidentally call methods on nil - config.whiny_nils = true - # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false @@ -29,9 +28,6 @@ Metamaps::Application.configure do # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict - # Print deprecation notices to the stderr config.active_support.deprecation = :stderr end