From 380faf7e76161ce59a423754b482567f607a666f Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Sat, 27 Sep 2014 00:08:13 -0300 Subject: [PATCH] rails4: upgrade initialization --- config/application.rb | 9 +++------ config/environments/cucumber.rb | 5 ++--- config/environments/development.rb | 3 +-- config/environments/production.rb | 2 ++ config/environments/test.rb | 5 ++--- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/config/application.rb b/config/application.rb index 0fb44b2..dbca09b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -8,12 +8,7 @@ require 'active_support/dependencies' # to work for now, but we should really look at putting those plugins away. ActiveSupport::Deprecation.silenced = true -if defined?(Bundler) - # If you precompile assets before deploying to production, use this line - Bundler.require(*Rails.groups(:assets => %w(development test))) - # If you want your assets lazily compiled in production, use this line - # Bundler.require(:default, :assets, Rails.env) -end +Bundler.require(:default, :assets, Rails.env) module Noosfero class Application < Rails::Application @@ -100,6 +95,8 @@ module Noosfero # no precedence over core Dir.glob("app/assets/designs/{icons,themes,user_themes}/*") + # disable strong_parameters before migration from protected_attributes + config.action_controller.permit_all_parameters = true # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' diff --git a/config/environments/cucumber.rb b/config/environments/cucumber.rb index 8284910..8db9555 100644 --- a/config/environments/cucumber.rb +++ b/config/environments/cucumber.rb @@ -7,10 +7,9 @@ Noosfero::Application.configure do # For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165 config.cache_classes = true - config.active_support.deprecation = :log + config.eager_load = false - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true + config.active_support.deprecation = :log # Show full error reports and disable caching config.action_controller.perform_caching = false diff --git a/config/environments/development.rb b/config/environments/development.rb index 874842a..4e8316d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -6,8 +6,7 @@ Noosfero::Application.configure do # since you don't have to restart the webserver when you make code changes. config.cache_classes = false - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true + config.eager_load = false # Show full error reports and disable caching config.action_controller.perform_caching = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 058171f..0609da9 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -5,6 +5,8 @@ Noosfero::Application.configure do # Code is not reloaded between requests config.cache_classes = true + config.eager_load = true + # Full error reports are disabled and caching is turned on # config.action_controller.perform_caching = true diff --git a/config/environments/test.rb b/config/environments/test.rb index cc7b7c5..70ebc40 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -7,13 +7,12 @@ Noosfero::Application.configure do # and recreated between test runs. Don't rely on the data there! config.cache_classes = true + config.eager_load = false + # Configure static asset server for tests with Cache-Control for performance 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.action_controller.perform_caching = false -- libgit2 0.21.2