From 44b752bea148b9df8f4d806e410e30fff26f680e Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Fri, 9 Jul 2010 16:39:34 -0400 Subject: expanding on :uniq option in has_many --- activerecord/lib/active_record/associations.rb | 2 +- railties/guides/source/association_basics.textile | 42 ++++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 65daa8ffbe..11555b88e0 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -889,7 +889,7 @@ module ActiveRecord # Specifies type of the source association used by has_many :through queries where the source # association is a polymorphic +belongs_to+. # [:uniq] - # If true, duplicates will be omitted from the collection. Useful in conjunction with :through. + # If true, duplicates will be omitted from the collection. Works only in conjunction with :through. # [:readonly] # If true, all the associated objects are readonly through the association. # [:validate] diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile index c69f2ae8c9..bc08874a30 100644 --- a/railties/guides/source/association_basics.textile +++ b/railties/guides/source/association_basics.textile @@ -1371,7 +1371,47 @@ The +:through+ option specifies a join model through which to perform the query. h6(#has_many-uniq). +:uniq+ -Specify the +:uniq => true+ option to remove duplicates from the collection. This is most useful in conjunction with the +:through+ option. +Specify the +:uniq => true+ option to remove duplicates from the collection. It only works with +:through+ option. + + +class Person < ActiveRecord::Base + has_many :readers + has_many :posts, :through => :readers + + def self.lab + person = Person.create(:name => 'john') + p = Post.create(:name => 'a1') + person.posts << p + person.posts << p + person.reload + puts person.posts.inspect #=> [#, #] + puts Reader.all.inspect #=> [#, #] + end +end + + +In the above case +readers+ table has two records and +person.posts+ brings out both of these records even though these records are basically pointing to the same +post+ record. + +Now let's add +uniq => true+ option. + + +class Person + has_many :readers + has_many :posts, :through => :readers, :uniq => true + + def self.experiment + person = Person.create(:name => 'honda') + p = Post.create(:name => 'a1') + person.posts << p + person.posts << p + person.reload + puts person.posts.inspect #=> [#] + puts Reader.all.inspect #=> [#, #] + end +end + + +In the above case +readers+ table still has two records. However +person.posts+ will show only one +post+ record because collection will load only +unique+ records. h6(#has_many-validate). +:validate+ -- cgit v1.2.3 From 86d5c728fbbce6ba8ae73f8926084f5c0eee9a41 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 10 Jul 2010 00:50:59 +0200 Subject: revises recent commit related to :uniq => true --- activerecord/lib/active_record/associations.rb | 2 +- railties/guides/source/association_basics.textile | 50 ++++++++++------------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 11555b88e0..65daa8ffbe 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -889,7 +889,7 @@ module ActiveRecord # Specifies type of the source association used by has_many :through queries where the source # association is a polymorphic +belongs_to+. # [:uniq] - # If true, duplicates will be omitted from the collection. Works only in conjunction with :through. + # If true, duplicates will be omitted from the collection. Useful in conjunction with :through. # [:readonly] # If true, all the associated objects are readonly through the association. # [:validate] diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile index bc08874a30..aec1b0732d 100644 --- a/railties/guides/source/association_basics.textile +++ b/railties/guides/source/association_basics.textile @@ -1371,47 +1371,41 @@ The +:through+ option specifies a join model through which to perform the query. h6(#has_many-uniq). +:uniq+ -Specify the +:uniq => true+ option to remove duplicates from the collection. It only works with +:through+ option. +Set the +:uniq+ option to true to keep the collection free of duplicates. This is mostly useful together with the +:through+ option. class Person < ActiveRecord::Base - has_many :readers - has_many :posts, :through => :readers - - def self.lab - person = Person.create(:name => 'john') - p = Post.create(:name => 'a1') - person.posts << p - person.posts << p - person.reload - puts person.posts.inspect #=> [#, #] - puts Reader.all.inspect #=> [#, #] - end + has_many :readings + has_many :posts, :through => :readings end + +person = Person.create(:name => 'john') +post = Post.create(:name => 'a1') +person.posts << post +person.posts << post +person.posts.inspect # => [#, #] +Reading.all.inspect # => [#, #] -In the above case +readers+ table has two records and +person.posts+ brings out both of these records even though these records are basically pointing to the same +post+ record. +In the above case there are two readings and +person.posts+ brings out both of them even though these records are pointing to the same post. -Now let's add +uniq => true+ option. +Now let's set +:uniq+ to true: class Person - has_many :readers - has_many :posts, :through => :readers, :uniq => true - - def self.experiment - person = Person.create(:name => 'honda') - p = Post.create(:name => 'a1') - person.posts << p - person.posts << p - person.reload - puts person.posts.inspect #=> [#] - puts Reader.all.inspect #=> [#, #] - end + has_many :readings + has_many :posts, :through => :readings, :uniq => true end + +person = Person.create(:name => 'honda') +post = Post.create(:name => 'a1') +person.posts << post +person.posts << post +person.posts.inspect # => [#] +Reading.all.inspect # => [#, #] -In the above case +readers+ table still has two records. However +person.posts+ will show only one +post+ record because collection will load only +unique+ records. +In the above case there are still two readings. However +person.posts+ shows only one post because collection loads only unique records. h6(#has_many-validate). +:validate+ -- cgit v1.2.3 From c81e476d6d4cb88e7e29d6e18bb3e5acce92fb8f Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 10 Jul 2010 00:56:17 +0200 Subject: missing article, only seen in github's colored diff by the beard of the prophet --- railties/guides/source/association_basics.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile index aec1b0732d..b1ee4b8be4 100644 --- a/railties/guides/source/association_basics.textile +++ b/railties/guides/source/association_basics.textile @@ -1405,7 +1405,7 @@ person.posts.inspect # => [#] Reading.all.inspect # => [#, #] -In the above case there are still two readings. However +person.posts+ shows only one post because collection loads only unique records. +In the above case there are still two readings. However +person.posts+ shows only one post because the collection loads only unique records. h6(#has_many-validate). +:validate+ -- cgit v1.2.3 From b0fab0c5c400bc5ca10908643e8b543767e50a29 Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 11 Jul 2010 19:17:36 +0200 Subject: Getting started guide: rephrase the paragraph about the root route for better understanding --- railties/guides/source/getting_started.textile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index f547f29087..8e018437fd 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -322,16 +322,15 @@ $ rm public/index.html We need to do this as Rails will deliver any static file in the +public+ directory in preference to any dynamic contact we generate from the controllers. -Now, you have to tell Rails where your actual home page is located. Open the file +config/routes.rb+ in your editor. This is your application's _routing file_ which holds entries in a special DSL (domain-specific language) that tells Rails how to connect incoming requests to controllers and actions. There are only comments in this file, so we need to add at the top the following: +Now, you have to tell Rails where your actual home page is located. Open the file +config/routes.rb+ in your editor. This is your application's _routing file_ which holds entries in a special DSL (domain-specific language) that tells Rails how to connect incoming requests to controllers and actions. This file contains many sample routes on commented lines, and one of them actually shows you how to connect the root of your site to a specific controller and action. Find the line beginning with +:root to+, uncomment it and change it like the following: Blog::Application.routes.draw do |map| - root :to => "home#index" - - # The priority is based upon order of creation: - # first created -> highest priority. #... + # You can have the root of your site routed with "root" + # just remember to delete public/index.html. + root :to => "home#index" The +root :to => "home#index"+ tells Rails to map the root action to the home controller's index action. -- cgit v1.2.3 From 1dddc79fee290702ccef75834ab85fddf3a5fd8f Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 11 Jul 2010 21:47:31 +0200 Subject: Getting started guide: Post validation example is clearer if we do p=Post.new;p.save better than p=Post.create;p.save --- railties/guides/source/getting_started.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 8e018437fd..7a5266ce2c 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -474,7 +474,7 @@ $ rails console After the console loads, you can use it to work with your application's models: ->> p = Post.create(:content => "A new post") +>> p = Post.new(:content => "A new post") => # -- cgit v1.2.3 From 1a35b6215fe4fb1630e2a635789038c5e6e56c63 Mon Sep 17 00:00:00 2001 From: Steven Hancock Date: Sun, 11 Jul 2010 23:57:26 -0700 Subject: Removed deprecated |map| block argument from routing docs since it is no longer generated in edge Rails config/routes.rb Didn't touch plugins guide since I'm not too clear on how routes work in plugins. --- actionpack/lib/action_dispatch/routing.rb | 2 +- actionpack/lib/action_view/helpers/atom_feed_helper.rb | 2 +- railties/guides/source/getting_started.textile | 2 +- railties/guides/source/i18n.textile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_dispatch/routing.rb b/actionpack/lib/action_dispatch/routing.rb index c664fb0bc2..da62b14f9b 100644 --- a/actionpack/lib/action_dispatch/routing.rb +++ b/actionpack/lib/action_dispatch/routing.rb @@ -31,7 +31,7 @@ module ActionDispatch # Think of creating routes as drawing a map for your requests. The map tells # them where to go based on some predefined pattern: # - # AppName::Application.routes.draw do |map| + # AppName::Application.routes.draw do # Pattern 1 tells some request to go to one place # Pattern 2 tell them to go to another # ... diff --git a/actionpack/lib/action_view/helpers/atom_feed_helper.rb b/actionpack/lib/action_view/helpers/atom_feed_helper.rb index cb5a1404ff..8e7cf2e701 100644 --- a/actionpack/lib/action_view/helpers/atom_feed_helper.rb +++ b/actionpack/lib/action_view/helpers/atom_feed_helper.rb @@ -10,7 +10,7 @@ module ActionView # Full usage example: # # config/routes.rb: - # Basecamp::Application.routes.draw do |map| + # Basecamp::Application.routes.draw do # resources :posts # root :to => "posts#index" # end diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index f547f29087..b4d1ae74c7 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -325,7 +325,7 @@ We need to do this as Rails will deliver any static file in the +public+ directo Now, you have to tell Rails where your actual home page is located. Open the file +config/routes.rb+ in your editor. This is your application's _routing file_ which holds entries in a special DSL (domain-specific language) that tells Rails how to connect incoming requests to controllers and actions. There are only comments in this file, so we need to add at the top the following: -Blog::Application.routes.draw do |map| +Blog::Application.routes.draw do root :to => "home#index" diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile index b09bb470ee..63d22db485 100644 --- a/railties/guides/source/i18n.textile +++ b/railties/guides/source/i18n.textile @@ -287,7 +287,7 @@ You most probably have something like this in one of your applications: # config/routes.rb -Yourapp::Application.routes.draw do |map| +Yourapp::Application.routes.draw do root :to => "home#index" end -- cgit v1.2.3 From cf69a010790d22dc2e66f172437c71ccff2e6366 Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Mon, 12 Jul 2010 18:23:13 +0200 Subject: Getting started guide: typos and changelog --- railties/guides/source/getting_started.textile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 7a5266ce2c..3a4f16c3cd 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -1193,7 +1193,7 @@ The +destroy+ action will find the post we are looking at, locate the comment wi h4. Deleting Associated Objects -If you delete a post then it's associated comments will also need to be deleted. Otherwise they would simply occupy space in the database. Rails allows you to use the +dependent+ option of an association to achieve this. Modify the Post model, +app/models/post.rb+, as follows: +If you delete a post then its associated comments will also need to be deleted. Otherwise they would simply occupy space in the database. Rails allows you to use the +dependent+ option of an association to achieve this. Modify the Post model, +app/models/post.rb+, as follows: class Post < ActiveRecord::Base @@ -1485,6 +1485,7 @@ h3. Changelog "Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/2 +* July 12, 2010: Fixes, editing and updating of code samples by "Jaime Iniesta":http://jaimeiniesta.com * May 16, 2010: Added a section on configuration gotchas to address common encoding problems that people might have by "Yehuda Katz":http://www.yehudakatz.com * April 30, 2010: Fixes, editing and updating of code samples by "Rohit Arondekar":http://rohitarondekar.com * April 25, 2010: Couple of more minor fixups "Mikel Lindsaar":credits.html#raasdnil -- cgit v1.2.3 From 7e075e62479a0eccad6eaf7a7c20f45347860c83 Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Fri, 9 Jul 2010 15:58:58 +0200 Subject: Fixed many references to the old config/environment.rb and Rails::Initializer --- actionmailer/lib/action_mailer/base.rb | 2 +- .../lib/action_controller/metal/mime_responds.rb | 2 +- .../middleware/session/cookie_store.rb | 2 +- .../lib/action_view/helpers/sanitize_helper.rb | 28 +++++++++++----------- .../connection_adapters/mysql_adapter.rb | 2 +- activerecord/lib/active_record/migration.rb | 2 +- activerecord/lib/active_record/observer.rb | 2 +- activerecord/lib/active_record/session_store.rb | 2 +- .../lib/active_support/values/time_zone.rb | 6 ++--- railties/lib/rails/generators/actions.rb | 4 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index ed4bea0c77..7f2ed5ba64 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -129,7 +129,7 @@ module ActionMailer #:nodoc: # # ActionMailer::Base.default_url_options[:host] = "example.com" # - # This can also be set as a configuration option in config/environment.rb: + # This can also be set as a configuration option in config/application.rb: # # config.action_mailer.default_url_options = { :host => "example.com" } # diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index 4f384d1ec5..c12e5797ae 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -145,7 +145,7 @@ module ActionController #:nodoc: # and accept Rails' defaults, life will be much easier. # # If you need to use a MIME type which isn't supported by default, you can register your own handlers in - # environment.rb as follows. + # config/initializers/mime_types.rb as follows. # # Mime::Type.register "image/jpg", :jpg # diff --git a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb index dce47c63bc..ca1494425f 100644 --- a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb @@ -35,7 +35,7 @@ module ActionDispatch # such as 'MD5', 'RIPEMD160', 'SHA256', etc. # # To generate a secret key for an existing application, run - # "rake secret" and set the key in config/environment.rb. + # "rake secret" and set the key in config/initializers/secret_token.rb. # # Note that changing digest or secret invalidates all existing sessions! class CookieStore < AbstractStore diff --git a/actionpack/lib/action_view/helpers/sanitize_helper.rb b/actionpack/lib/action_view/helpers/sanitize_helper.rb index b47818a22a..63f6154ec4 100644 --- a/actionpack/lib/action_view/helpers/sanitize_helper.rb +++ b/actionpack/lib/action_view/helpers/sanitize_helper.rb @@ -32,13 +32,13 @@ module ActionView # # Add table tags to the default allowed tags # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_allowed_tags = 'table', 'tr', 'td' # end # # Remove tags to the default allowed tags # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.after_initialize do # ActionView::Base.sanitized_allowed_tags.delete 'div' # end @@ -46,7 +46,7 @@ module ActionView # # Change allowed default attributes # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_allowed_attributes = 'id', 'class', 'style' # end # @@ -143,7 +143,7 @@ module ActionView # Gets the HTML::FullSanitizer instance used by +strip_tags+. Replace with # any object that responds to +sanitize+. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.full_sanitizer = MySpecialSanitizer.new # end # @@ -154,7 +154,7 @@ module ActionView # Gets the HTML::LinkSanitizer instance used by +strip_links+. Replace with # any object that responds to +sanitize+. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.link_sanitizer = MySpecialSanitizer.new # end # @@ -165,7 +165,7 @@ module ActionView # Gets the HTML::WhiteListSanitizer instance used by sanitize and +sanitize_css+. # Replace with any object that responds to +sanitize+. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.white_list_sanitizer = MySpecialSanitizer.new # end # @@ -175,7 +175,7 @@ module ActionView # Adds valid HTML attributes that the +sanitize+ helper checks for URIs. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_uri_attributes = 'lowsrc', 'target' # end # @@ -185,7 +185,7 @@ module ActionView # Adds to the Set of 'bad' tags for the +sanitize+ helper. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_bad_tags = 'embed', 'object' # end # @@ -195,7 +195,7 @@ module ActionView # Adds to the Set of allowed tags for the +sanitize+ helper. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_allowed_tags = 'table', 'tr', 'td' # end # @@ -205,7 +205,7 @@ module ActionView # Adds to the Set of allowed HTML attributes for the +sanitize+ helper. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_allowed_attributes = 'onclick', 'longdesc' # end # @@ -215,7 +215,7 @@ module ActionView # Adds to the Set of allowed CSS properties for the #sanitize and +sanitize_css+ helpers. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_allowed_css_properties = 'expression' # end # @@ -225,7 +225,7 @@ module ActionView # Adds to the Set of allowed CSS keywords for the +sanitize+ and +sanitize_css+ helpers. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_allowed_css_keywords = 'expression' # end # @@ -235,7 +235,7 @@ module ActionView # Adds to the Set of allowed shorthand CSS properties for the +sanitize+ and +sanitize_css+ helpers. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_shorthand_css_properties = 'expression' # end # @@ -245,7 +245,7 @@ module ActionView # Adds to the Set of allowed protocols for the +sanitize+ helper. # - # Rails::Initializer.run do |config| + # class Application < Rails::Application # config.action_view.sanitized_allowed_protocols = 'ssh', 'feed' # end # diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index aa3626a37e..b403443d8e 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -125,7 +125,7 @@ module ActiveRecord # By default, the MysqlAdapter will consider all columns of type tinyint(1) # as boolean. If you wish to disable this emulation (which was the default # behavior in versions 0.13.1 and earlier) you can add the following line - # to your environment.rb file: + # to your application.rb file: # # ActiveRecord::ConnectionAdapters::MysqlAdapter.emulate_booleans = false cattr_accessor :emulate_booleans diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 4c5e1ae218..5e272f0ba4 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -284,7 +284,7 @@ module ActiveRecord # # config.active_record.timestamped_migrations = false # - # In environment.rb. + # In application.rb. # class Migration @@verbose = true diff --git a/activerecord/lib/active_record/observer.rb b/activerecord/lib/active_record/observer.rb index d2ed643f35..ce002f5e1a 100644 --- a/activerecord/lib/active_record/observer.rb +++ b/activerecord/lib/active_record/observer.rb @@ -68,7 +68,7 @@ module ActiveRecord # == Configuration # # In order to activate an observer, list it in the config.active_record.observers configuration setting in your - # config/environment.rb file. + # config/application.rb file. # # config.active_record.observers = :comment_observer, :signup_observer # diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb index b88d550086..df2f429c5d 100644 --- a/activerecord/lib/active_record/session_store.rb +++ b/activerecord/lib/active_record/session_store.rb @@ -16,7 +16,7 @@ module ActiveRecord # ActionController::SessionOverflowError will be raised. # # You may configure the table name, primary key, and data column. - # For example, at the end of config/environment.rb: + # For example, at the end of config/application.rb: # # ActiveRecord::SessionStore::Session.table_name = 'legacy_session_table' # ActiveRecord::SessionStore::Session.primary_key = 'session_id' diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 49dd8a1b99..abd585b64f 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -8,10 +8,10 @@ require 'active_support/core_ext/object/try' # * Lazily load TZInfo::Timezone instances only when they're needed. # * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+, +parse+, +at+ and +now+ methods. # -# If you set config.time_zone in the Rails Initializer, you can access this TimeZone object via Time.zone: +# If you set config.time_zone in the Rails Application, you can access this TimeZone object via Time.zone: # -# # environment.rb: -# Rails::Initializer.run do |config| +# # application.rb: +# class Application < Rails::Application # config.time_zone = "Eastern Time (US & Canada)" # end # diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index a27d38e23a..2280cc1507 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -40,7 +40,7 @@ module Rails end end - # Adds an entry into config/environment.rb for the supplied gem. If env + # Adds an entry into Gemfile for the supplied gem. If env # is specified, add the gem to the given environment. # # ==== Example @@ -100,7 +100,7 @@ module Rails end end - # Adds a line inside the Initializer block for config/environment.rb. + # Adds a line inside the Application class for config/application.rb. # # If options :env is specified, the line is appended to the corresponding # file in config/environments. -- cgit v1.2.3