From 3860fa45c2accd735875eef78c6ce05b23e5960f Mon Sep 17 00:00:00 2001 From: Thiago Ribeiro Date: Fri, 6 Mar 2015 19:27:19 -0300 Subject: [PATCH] Old settings commented and new added closes #103 Some warnings are generated when migrating the rails 3 to 4 rails and file "config /" are not updated With these changes the mode of development on bulletin out. Signed-off-by: Thiago Ribeiro --- config/application.rb | 11 ++++++++--- config/environments/development.rb | 29 ++++++++++++++++++++++++++--- config/environments/production.rb | 3 +++ 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/config/application.rb b/config/application.rb index 859633e32..70c9f67ab 100644 --- a/config/application.rb +++ b/config/application.rb @@ -7,18 +7,23 @@ end module Selfstarter - + class Application < Rails::Application # --- Standard Rails Config --- config.time_zone = 'Pacific Time (US & Canada)' config.encoding = "utf-8" config.filter_parameters += [:password] - config.active_record.whitelist_attributes = true + + #DEPRECATION WARNING: Model based mass assignment security has been extracted + #out of Rails into a gem. Please use the new recommended protection model for + #params or add `protected_attributes` to your Gemfile to use the old one. + #config.active_record.whitelist_attributes = true + # Enable the asset pipeline config.assets.enabled = true # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' # --- Standard Rails Config --- end -end \ No newline at end of file +end diff --git a/config/environments/development.rb b/config/environments/development.rb index d36d45a39..c5554f978 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -7,7 +7,11 @@ config.cache_classes = false # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true + #config.whiny_nils = true + #DEPRECATION WARNING: config.whiny_nils option is deprecated and no longer works. + + # Do not eager load code on boot. + config.eager_load = false # Show full error reports and disable caching config.consider_all_requests_local = true @@ -16,22 +20,41 @@ # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + # Print deprecation notices to the Rails logger config.active_support.deprecation = :log + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + # 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 + #config.active_record.mass_assignment_sanitizer = :strict + #DEPRECATION WARNING: Model based mass assignment security has been extracted + #out of Rails into a gem. Please use the new recommended protection model for + #params or add `protected_attributes` to your Gemfile to use the old one. # 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 + #config.active_record.auto_explain_threshold_in_seconds = 0.5 + #DEPRECATION WARNING: The Active Record auto explain feature has been removed. # Do not compress assets config.assets.compress = false # Expands the lines which load the assets config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index 9d5fdbc47..30b27e250 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -20,6 +20,9 @@ # Generate digests for assets URLs config.assets.digest = true + #Rails 4 upgrade + config.eager_load = true + config.assets.js_compressor = :uglifier # Defaults to nil and saved in location specified by config.assets.prefix # config.assets.manifest = YOUR_PATH