Skip to content

Commit

Permalink
Upgrade to rails 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Soltys committed Feb 26, 2012
1 parent dc3cbee commit a47d409
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 31 deletions.
18 changes: 12 additions & 6 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

require 'rails/all'

# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
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

module LandInfo
class Application < Rails::Application
Expand All @@ -30,13 +33,16 @@ class Application < Rails::Application
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de

# JavaScript files you want as :defaults (application.js is always included).
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)

# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]

# 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'
end
end
4 changes: 0 additions & 4 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Load the rails application
require File.expand_path('../application', __FILE__)

unless $CLASSPATH.nil?
$CLASSPATH << "file:///#{Rails.root}/lib/java/mysql-connector-java-5.1.15-bin.jar"
end

# Initialize the rails application
LandInfo::Application.initialize!
9 changes: 7 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# 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 webserver when you make code changes.
# 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.
Expand All @@ -21,5 +21,10 @@

# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
end

# Do not compress assets
config.assets.compress = false

# Expands the lines which load the assets
config.assets.debug = true
end
35 changes: 23 additions & 12 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
LandInfo::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true

# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = "X-Sendfile"
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false

# Compress JavaScripts and CSS
config.assets.compress = true

# 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

# For nginx:
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH

# If you have no front-end server that supports something like X-Sendfile,
# just comment this out and Rails will serve the files
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true

# See everything in the log (default is :info)
# config.log_level = :debug
Expand All @@ -27,13 +39,12 @@
# Use a different cache store in production
# config.cache_store = :mem_cache_store

# Disable Rails's static asset server
# In production, Apache or nginx will already do this
config.serve_static_assets = false

# Enable serving of images, stylesheets, and javascripts from an asset server
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )

# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false

Expand Down
6 changes: 5 additions & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true

# Log error messages when you accidentally call methods on nil.
# 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
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/secret_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
LandInfo::Application.config.secret_token = 'f7d7793d4674a0bc2ebce2b380c459cd0eeda08e6033af0eb16247d3503d6261f99dfe3290c12504b58cbd1c4678ae1d7a546147a9100604a90ebd9027baa5fd'
LandInfo::Application.config.secret_token = '32e2452da9683cb2acfc2ce223fa5fc93c7f439d43df4a3513a0780af967e2a1a2e16c1e3d4e94bae16601b39b62db638cba079e4a521cb7e64ba61d7b30912e'
2 changes: 1 addition & 1 deletion config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.

LandInfo::Application.config.session_store :cookie_store, :key => '_land_info_session'
LandInfo::Application.config.session_store :cookie_store, key: '_land_info_session'

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
Expand Down
14 changes: 14 additions & 0 deletions config/initializers/wrap_parameters.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.

# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json]
end

# Disable root element in JSON by default.
ActiveSupport.on_load(:active_record) do
self.include_root_in_json = false
end
5 changes: 1 addition & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.

en:
hello: "Hello world"
time:
formats:
default: "%a, %d %b %Y %H:%M:%S"

0 comments on commit a47d409

Please sign in to comment.