Commit 70c5e3e318955c65f555f70a4e6421007ab8882c

Authored by Rafael Manzo
1 parent 9185ebc5

rails files modified accordingly to a newly generated app

This ensures that we are up-to-date with the latest configuration standards
@@ -78,10 +78,10 @@ group :test do @@ -78,10 +78,10 @@ group :test do
78 end 78 end
79 79
80 group :development, :test do 80 group :development, :test do
81 - # Call 'debugger' anywhere in the code to stop execution and get a debugger console 81 + # Call 'byebug' anywhere in the code to stop execution and get a debugger console
82 gem 'byebug' 82 gem 'byebug'
83 83
84 - # Access an IRB console on exceptions page and /console in development 84 + # Access an IRB console on exception pages or by using <%= console %> in views
85 gem 'web-console', '~> 2.0.0' 85 gem 'web-console', '~> 2.0.0'
86 86
87 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 87 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
app/assets/javascripts/application.js
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 // listed below. 2 // listed below.
3 // 3 //
4 // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 4 // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 5 +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6 // 6 //
7 // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 7 // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 // compiled file. 8 // compiled file.
app/assets/stylesheets/application.css
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 * listed below. 3 * listed below.
4 * 4 *
5 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 5 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 6 + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7 * 7 *
8 * You're free to add application-wide styles to this file and they'll appear at the bottom of the 8 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 * compiled file so the styles you add here take precedence over styles defined in any styles 9 * compiled file so the styles you add here take precedence over styles defined in any styles
1 #!/usr/bin/env ruby 1 #!/usr/bin/env ruby
2 2
3 -# This file loads spring without using Bundler, in order to be fast  
4 -# It gets overwritten when you run the `spring binstub` command 3 +# This file loads spring without using Bundler, in order to be fast.
  4 +# It gets overwritten when you run the `spring binstub` command.
5 5
6 unless defined?(Spring) 6 unless defined?(Spring)
7 require "rubygems" 7 require "rubygems"
8 require "bundler" 8 require "bundler"
9 9
10 - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)  
11 - ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)  
12 - ENV["GEM_HOME"] = ""  
13 - Gem.paths = ENV  
14 - 10 + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
  11 + Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
15 gem "spring", match[1] 12 gem "spring", match[1]
16 require "spring/binstub" 13 require "spring/binstub"
17 end 14 end
1 # This file is used by Rack-based servers to start the application. 1 # This file is used by Rack-based servers to start the application.
2 2
3 -require ::File.expand_path('../config/environment', __FILE__) 3 +require ::File.expand_path('../config/environment', __FILE__)
4 run Rails.application 4 run Rails.application
config/application.rb
@@ -21,7 +21,7 @@ module Mezuro @@ -21,7 +21,7 @@ module Mezuro
21 # config.i18n.default_locale = :de 21 # config.i18n.default_locale = :de
22 config.i18n.enforce_available_locales = true 22 config.i18n.enforce_available_locales = true
23 23
24 - # For not swallow errors in after_commit/after_rollback callbacks. 24 + # Do not swallow errors in after_commit/after_rollback callbacks.
25 config.active_record.raise_in_transactional_callbacks = true 25 config.active_record.raise_in_transactional_callbacks = true
26 end 26 end
27 end 27 end
config/boot.rb
1 -# Set up gems listed in the Gemfile.  
2 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 1 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 2
4 require 'bundler/setup' # Set up gems listed in the Gemfile 3 require 'bundler/setup' # Set up gems listed in the Gemfile
config/environments/production.rb
@@ -16,11 +16,12 @@ Rails.application.configure do @@ -16,11 +16,12 @@ Rails.application.configure do
16 16
17 # Enable Rack::Cache to put a simple HTTP cache in front of your application 17 # Enable Rack::Cache to put a simple HTTP cache in front of your application
18 # Add `rack-cache` to your Gemfile before enabling this. 18 # Add `rack-cache` to your Gemfile before enabling this.
19 - # For large-scale production use, consider using a caching reverse proxy like NGINX, varnish or squid.  
20 - # config.action_dispatch.rack_cache = true 19 + # For large-scale production use, consider using a caching reverse proxy like
  20 + # NGINX, varnish or squid.
21 21
22 - # Disable Rails's static asset server (Apache or NGINX will already do this).  
23 - config.serve_static_files = false 22 + # Disable serving static files from the `/public` folder by default since
  23 + # Apache or NGINX already handles this.
  24 + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
24 25
25 # Compress JavaScripts and CSS. 26 # Compress JavaScripts and CSS.
26 config.assets.js_compressor = :uglifier 27 config.assets.js_compressor = :uglifier
@@ -42,8 +43,9 @@ Rails.application.configure do @@ -42,8 +43,9 @@ Rails.application.configure do
42 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 43 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43 # config.force_ssl = true 44 # config.force_ssl = true
44 45
45 - # Decrease the log volume.  
46 - config.log_level = :info 46 + # Use the lowest log level to ensure availability of diagnostic information
  47 + # when problems arise.
  48 + config.log_level = :debug
47 49
48 # Prepend all log lines with the following tags. 50 # Prepend all log lines with the following tags.
49 # config.log_tags = [ :subdomain, :uuid ] 51 # config.log_tags = [ :subdomain, :uuid ]
@@ -55,7 +57,7 @@ Rails.application.configure do @@ -55,7 +57,7 @@ Rails.application.configure do
55 config.cache_store = :mem_cache_store, "10.2.2.21", {expires_in: 1.day} 57 config.cache_store = :mem_cache_store, "10.2.2.21", {expires_in: 1.day}
56 58
57 # Enable serving of images, stylesheets, and JavaScripts from an asset server. 59 # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58 - # config.action_controller.asset_host = "http://assets.example.com" 60 + # config.action_controller.asset_host = 'http://assets.example.com'
59 61
60 # Ignore bad email addresses and do not raise email delivery errors. 62 # Ignore bad email addresses and do not raise email delivery errors.
61 # Set this to true and configure the email server for immediate delivery to raise delivery errors. 63 # Set this to true and configure the email server for immediate delivery to raise delivery errors.
config/environments/test.rb
@@ -12,7 +12,7 @@ Rails.application.configure do @@ -12,7 +12,7 @@ Rails.application.configure do
12 # preloads Rails for running tests, you may have to set it to true. 12 # preloads Rails for running tests, you may have to set it to true.
13 config.eager_load = false 13 config.eager_load = false
14 14
15 - # Configure static asset server for tests with Cache-Control for performance. 15 + # Configure static file server for tests with Cache-Control for performance.
16 config.serve_static_files = true 16 config.serve_static_files = true
17 config.static_cache_control = 'public, max-age=3600' 17 config.static_cache_control = 'public, max-age=3600'
18 18