Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Moving locale stuff from app.rb to an initializer. #7873

Merged
merged 1 commit into from

3 participants

@steveklabnik
Collaborator

As requested by @dhh.

@dhh dhh merged commit 43e14f8 into from
@vijaydev
Collaborator

@steveklabnik Hey, will you be able to skim the guides once to see if we explicitly mention the location of these configs as 'application.rb' anywhere?

@steveklabnik
Collaborator

@vijaydev yes, I will do that now.

@steveklabnik
Collaborator
@carlosantoniodasilva carlosantoniodasilva referenced this pull request from a commit in carlosantoniodasilva/rails
@carlosantoniodasilva carlosantoniodasilva Revert "Merge pull request #7873 from steveklabnik/update_initializer"
This reverts commit 43e14f8, reversing
changes made to bb17a0f.

Conflicts:
	railties/lib/rails/generators/rails/app/templates/config/application.rb
	railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb

Reason: setting the Time.zone in an after_initialize block can become a
problem for people upgrading, since it's not going to be available when
config/initializers run, and people might be relying on it.

An example that I noticed was with the Chronic gem, for date/time parsing.
It requires us to configure the time class to be Time.zone, and doing
that in an initializer no longer worked with these changes, so reverting
is the safer path for now.
6fcdcfe
@tenderlove tenderlove referenced this pull request from a commit
@tenderlove tenderlove Merge branch 'master' into jobs
* master:
  Less strict activerecord-deprecated_finders version
  Revert "Round usec when writing timestamp attribute."
  Add failing test case for #8460
  Lets kepp using Ruby 1.9 syntax
  Only check for unpermmited parameters if action_on_unpermitted_parameters is present
  Revert "Merge pull request #7873 from steveklabnik/update_initializer"
  Revert "Set the default timezone after the initialization since the configuration"
  Revert "updating i18n guide with locale config location."
  avoid creating an object in every call
  Remove unnecessary require
  Re-do Getting Started application with Rails 4.
  fixing link to validations guide in getting started guide
  Getting Started Guide: strong_parameters
  Fix images in getting started guide.
  Remove tabs, use spaces :scissors:
  Whitespaces :scissors:
f0f146d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
8 railties/lib/rails/generators/rails/app/templates/config/application.rb
@@ -23,14 +23,6 @@ class Application < Rails::Application
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
- # 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. Default is UTC.
- # config.time_zone = 'Central Time (US & Canada)'
-
- # 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}').to_s]
- # config.i18n.default_locale = :de
-
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
View
7 railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb
@@ -0,0 +1,7 @@
+# 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. Default is UTC.
+# Rails.config.time_zone = 'Central Time (US & Canada)'
+
+# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+# Rails.config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+# Rails.config.i18n.default_locale = :de
Something went wrong with that request. Please try again.