Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Even more polish of the default configration files and split off the …

…session store configuration into its own file
  • Loading branch information...
commit 6e66e7d6460b99bb0877a891aa3fbb789b563123 1 parent c5f461d
@dhh dhh authored
View
13 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
View
37 railties/environments/environment.rb
@@ -12,7 +12,7 @@
# -- 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 )
@Roman2K
Roman2K added a note

%W was correct. %w won’t perform interpolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
# Specify gems that this application depends on and have them installed with rake gems:install
# config.gem "bj"
@@ -28,35 +28,14 @@
# 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}')]
@Roman2K
Roman2K added a note

This line should rather read: config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
# 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
View
5 railties/environments/test.rb
@@ -20,3 +20,8 @@
# 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

3 comments on commit 6e66e7d

@henrik

So it wasn’t first changed in this commit, but: on line 32 of the new version, observers are assigned as “config.active_record.observers = :cacher, :garbage_collector, :forum_observer”. Is that missing square brackets?

@dennisreimann

yes, they are missing.

@Roman2K

%W was correct. %w won’t perform interpolation.

@Roman2K

This line should rather read: config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]

@dhh
Owner

Thanks for the code review, guys. Got it in on http://github.com/rails/rails/commit/bf024b6a11253b3d2599caf41f7ccf2d31e68cb3

Please sign in to comment.
Something went wrong with that request. Please try again.