From 6e66e7d6460b99bb0877a891aa3fbb789b563123 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 30 Nov 2008 15:53:21 -0600 Subject: Even more polish of the default configration files and split off the session store configuration into its own file --- railties/configs/initializers/session_store.rb | 13 +++++++++ railties/environments/environment.rb | 37 ++++++-------------------- railties/environments/test.rb | 5 ++++ 3 files changed, 26 insertions(+), 29 deletions(-) create mode 100644 railties/configs/initializers/session_store.rb (limited to 'railties') diff --git a/railties/configs/initializers/session_store.rb b/railties/configs/initializers/session_store.rb new file mode 100644 index 0000000000..29bfbe68a8 --- /dev/null +++ b/railties/configs/initializers/session_store.rb @@ -0,0 +1,13 @@ +# Your secret key for verifying cookie session data integrity. +# If you change this key, all old sessions 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. +ActionController::Base.session = { + :session_key => '_<%= app_name %>_session', + :secret => '<%= app_secret %>' +} + +# Use the database for sessions instead of the cookie-based default, +# which shouldn't be used to store highly confidential information +# (create the session table with "rake db:sessions:create") +# ActionController::Base.session_store = :active_record_store diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 66f71e5d9b..392e12f438 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -12,7 +12,7 @@ Rails::Initializer.run do |config| # -- all .rb files in that directory are automatically loaded. # Add additional load paths for your own custom dirs - # config.load_paths += %W( #{RAILS_ROOT}/extras ) + # config.load_paths += %w( #{RAILS_ROOT}/extras ) # Specify gems that this application depends on and have them installed with rake gems:install # config.gem "bj" @@ -28,35 +28,14 @@ Rails::Initializer.run do |config| # you must remove the Active Record framework. # config.frameworks -= [ :active_record, :active_resource, :action_mailer ] - # Make Time.zone default to the specified zone, and make Active Record store time values - # in the database in UTC, and return them converted to the specified local zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Comment line to use default local time. + # Activate observers that should always be running + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. config.time_zone = 'UTC' - # The internationalization framework can be changed to have another default locale (default is :en) or more load paths. - # All files from config/locales/*.rb,yml are added automatically. + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path << Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] # config.i18n.default_locale = :de - - # Your secret key for verifying cookie session data integrity. - # If you change this key, all old sessions 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. - config.action_controller.session = { - :session_key => '_<%= app_name %>_session', - :secret => '<%= app_secret %>' - } - - # Use the database for sessions instead of the cookie-based default, - # which shouldn't be used to store highly confidential information - # (create the session table with "rake db:sessions:create") - # config.action_controller.session_store = :active_record_store - - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Activate observers that should always be running - # config.active_record.observers = :cacher, :garbage_collector, :forum_observer -end +end \ No newline at end of file diff --git a/railties/environments/test.rb b/railties/environments/test.rb index 1e709e1d19..496eb9572b 100644 --- a/railties/environments/test.rb +++ b/railties/environments/test.rb @@ -20,3 +20,8 @@ config.action_controller.allow_forgery_protection = false # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + +# Use SQL instead of Active Record's schema dumper when creating the test database. +# This is necessary if your schema can't be completely dumped by the schema dumper, +# like if you have constraints or database-specific column types +# config.active_record.schema_format = :sql \ No newline at end of file -- cgit v1.2.3