From 090d12b49b80303ad521ce75b01ea89752417303 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Jan 2010 21:32:02 -0500 Subject: Added that ActionController::Base now does helper :all instead of relying on the default ApplicationController in Rails to do it [DHH] --- .../rails/app/templates/app/controllers/application_controller.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb b/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb index 9889b52893..643a7ca16d 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb +++ b/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb @@ -2,7 +2,6 @@ # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base - helper :all protect_from_forgery filter_parameter_logging :password end -- cgit v1.2.3 From 950e6bb4912bc87e693eab8731920a122bcff2c2 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Jan 2010 21:32:40 -0500 Subject: Remove self-evident comment about how subclasses work --- .../rails/app/templates/app/controllers/application_controller.rb | 3 --- 1 file changed, 3 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb b/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb index 643a7ca16d..2cdf4eae54 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb +++ b/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb @@ -1,6 +1,3 @@ -# Filters added to this controller apply to all controllers in the application. -# Likewise, all the methods added will be available for all controllers. - class ApplicationController < ActionController::Base protect_from_forgery filter_parameter_logging :password -- cgit v1.2.3 From 51460b5bf296d7f262f8d865f6f6f1d44513c6d4 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Jan 2010 21:34:19 -0500 Subject: This comment has been true of all helpers for a long time --- .../generators/rails/app/templates/app/helpers/application_helper.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb b/railties/lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb index 22a7940eb2..de6be7945c 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb +++ b/railties/lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb @@ -1,3 +1,2 @@ -# Methods added to this helper will be available to all templates in the application. module ApplicationHelper end -- cgit v1.2.3 From 0422314b29e6b59362eb1111c983740784428b73 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Jan 2010 21:55:48 -0500 Subject: Time zoning should be turned on by default with UTC --- .../lib/rails/generators/rails/app/templates/config/application.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index ec0729db04..b6c1cef8cd 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -17,15 +17,14 @@ module <%= app_name.classify %> # 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' + # 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}')] # config.i18n.default_locale = :de - # Configure generators values. Many other options are available, be sure to - # check the documentation. + # Configure generators values. Many other options are available, be sure to check the documentation. # config.generators do |g| # g.orm :active_record # g.template_engine :erb -- cgit v1.2.3 From 6042067c0b20602e72954450e9e8a19dfa8a9f7d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Jan 2010 19:20:43 -0800 Subject: Changed the default ActiveSupport.use_standard_json_time_format from false to true and ActiveSupport.escape_html_entities_in_json from true to false to match previously announced Rails 3 defaults [DHH] --- .../app/templates/config/initializers/new_rails_defaults.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/new_rails_defaults.rb b/railties/lib/rails/generators/rails/app/templates/config/initializers/new_rails_defaults.rb index 8ec3186c84..91a8fdb688 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/initializers/new_rails_defaults.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/new_rails_defaults.rb @@ -4,16 +4,6 @@ # for Rails 3. You can remove this initializer when Rails 3 is released. if defined?(ActiveRecord) - # Include Active Record class name as root for JSON serialized output. - ActiveRecord::Base.include_root_in_json = true - # Store the full class name (including module namespace) in STI type column. ActiveRecord::Base.store_full_sti_class = true -end - -# Use ISO 8601 format for JSON serialized times and dates. -ActiveSupport.use_standard_json_time_format = true - -# Don't escape HTML entities in JSON, leave that for the #json_escape helper. -# if you're including raw json in an HTML page. -ActiveSupport.escape_html_entities_in_json = false \ No newline at end of file +end \ No newline at end of file -- cgit v1.2.3 From 0ad07d9c26321f426d7d4c234d476e71d1537efb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Jan 2010 19:32:48 -0800 Subject: Removed config/initializers/new_rails_defaults.rb as all frameworks now follow the settings from it [DHH] --- .../app/templates/config/initializers/new_rails_defaults.rb | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 railties/lib/rails/generators/rails/app/templates/config/initializers/new_rails_defaults.rb (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/new_rails_defaults.rb b/railties/lib/rails/generators/rails/app/templates/config/initializers/new_rails_defaults.rb deleted file mode 100644 index 91a8fdb688..0000000000 --- a/railties/lib/rails/generators/rails/app/templates/config/initializers/new_rails_defaults.rb +++ /dev/null @@ -1,9 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# These settings change the behavior of Rails 2 apps and will be defaults -# for Rails 3. You can remove this initializer when Rails 3 is released. - -if defined?(ActiveRecord) - # Store the full class name (including module namespace) in STI type column. - ActiveRecord::Base.store_full_sti_class = true -end \ No newline at end of file -- cgit v1.2.3 From 437df4a8d3385bd28812cf6ca5662287d5246517 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Jan 2010 19:46:10 -0800 Subject: Describe intent, not implementation --- railties/lib/rails/generators/rails/app/templates/config.ru | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/templates/config.ru b/railties/lib/rails/generators/rails/app/templates/config.ru index acb8435446..2ab821e38d 100644 --- a/railties/lib/rails/generators/rails/app/templates/config.ru +++ b/railties/lib/rails/generators/rails/app/templates/config.ru @@ -1,5 +1,4 @@ -# Require your environment file to bootstrap Rails -require ::File.expand_path('../config/environment', __FILE__) +# This file is used by Rack-based servers to start the application. -# Dispatch the request +require ::File.expand_path('../config/environment', __FILE__) run <%= app_const %>.instance -- cgit v1.2.3 From d7d917335e242f48fae31bc99e6d4ab381244913 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Jan 2010 19:55:21 -0800 Subject: Stop featuring ActiveSupport::TestCase.use_instantiated_fixtures and ActiveSupport::TestCase.use_transactional_fixtures as likely-to-change settings in test/test_helper.rb -- they are not and their values are already set in test_help.rb [DHH] --- .../rails/app/templates/test/test_helper.rb | 25 ---------------------- 1 file changed, 25 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb index a16f587d8b..45b551fc7d 100644 --- a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb +++ b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb @@ -3,31 +3,6 @@ require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'rails/test_help' class ActiveSupport::TestCase - # Transactional fixtures accelerate your tests by wrapping each test method - # in a transaction that's rolled back on completion. This ensures that the - # test database remains unchanged so your fixtures don't have to be reloaded - # between every test method. Fewer database queries means faster tests. - # - # Read Mike Clark's excellent walkthrough at - # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting - # - # Every Active Record database supports transactions except MyISAM tables - # in MySQL. Turn off transactional fixtures in this case; however, if you - # don't care one way or the other, switching from MyISAM to InnoDB tables - # is recommended. - # - # The only drawback to using transactional fixtures is when you actually - # need to test transactions. Since your test is bracketed by a transaction, - # any transactions started in your code will be automatically rolled back. - self.use_transactional_fixtures = true - - # Instantiated fixtures are slow, but give you @david where otherwise you - # would need people(:david). If you don't want to migrate your existing - # test cases which use the @david style and don't mind the speed hit (each - # instantiated fixtures translates to a database query per test method), - # then set this back to true. - self.use_instantiated_fixtures = false - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # # Note: You'll currently still have to declare fixtures explicitly in integration tests -- cgit v1.2.3 From 2601a16ede92566c651c06942294250ea653bd85 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 4 Jan 2010 16:22:39 -0600 Subject: Autoload AS test case --- railties/lib/rails/generators/test_case.rb | 9 ++++----- .../rails/generators/test_unit/plugin/templates/test_helper.rb | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index 643d7856c5..38a3cbb035 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -1,4 +1,3 @@ -require 'active_support/test_case' require 'active_support/core_ext/class/inheritable_attributes' require 'active_support/core_ext/hash/reverse_merge' require 'rails/generators' @@ -76,7 +75,7 @@ module Rails eval "$#{stream} = StringIO.new" yield result = eval("$#{stream}").string - ensure + ensure eval("$#{stream} = #{stream.upcase}") end @@ -137,9 +136,9 @@ module Rails # # assert_migration "db/migrate/create_products.rb" # - # This method manipulates the given path and tries to find any migration which + # This method manipulates the given path and tries to find any migration which # matches the migration name. For example, the call above is converted to: - # + # # assert_file "db/migrate/003_create_products.rb" # # Consequently, assert_migration accepts the same arguments has assert_file. @@ -236,4 +235,4 @@ module Rails end end end -end \ No newline at end of file +end diff --git a/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb b/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb index 348ec33582..2ca36a1e44 100644 --- a/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +++ b/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb @@ -1,5 +1,3 @@ require 'rubygems' require 'test/unit' require 'active_support' -require 'active_support/test_case' - -- cgit v1.2.3 From 952e449fc0b9adce240df6197a189d179f5e5b7f Mon Sep 17 00:00:00 2001 From: Carlhuda Date: Mon, 4 Jan 2010 16:32:43 -0800 Subject: Fix --dev option --- railties/lib/rails/generators/rails/app/templates/Gemfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 59c6d333e2..7b5c89c3e2 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -5,7 +5,8 @@ gem "rails", "<%= Rails::VERSION::STRING %>" ## Bundle edge rails: <%- if options.dev? -%> -gem "rails", :path => "<%= Rails::Generators::RAILS_DEV_PATH %>" +directory "<%= Rails::Generators::RAILS_DEV_PATH %>", :glob => "{*/,}*.gemspec" +gem "rails", "<%= Rails::VERSION::STRING %>" <%- else -%> <%= "# " unless options.edge? %>gem "rails", :git => "git://github.com/rails/rails.git" <%- end -%> -- cgit v1.2.3 From 38f669766cb4d328e121afab020f4a52ca45421f Mon Sep 17 00:00:00 2001 From: Dan Croak Date: Tue, 5 Jan 2010 10:13:29 -0600 Subject: Rails layouts, error pages, and public/index now use HTML5. The specification allows the character encoding meta tag to be removed if character encoding is set at the transport level (Content-Type), which Rails is doing. http://dev.w3.org/html5/html4-differences/#character-encoding Signed-off-by: Joshua Peek --- railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb | 1 - railties/lib/rails/generators/rails/app/templates/public/404.html | 1 - railties/lib/rails/generators/rails/app/templates/public/422.html | 1 - railties/lib/rails/generators/rails/app/templates/public/500.html | 1 - railties/lib/rails/generators/rails/app/templates/public/index.html | 1 - 5 files changed, 5 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb index 51c4ad0e2e..7aa049fe80 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb +++ b/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb @@ -1,7 +1,6 @@ - <%= controller_class_name %>: <%%= controller.action_name %> <%%= stylesheet_link_tag 'scaffold' %> diff --git a/railties/lib/rails/generators/rails/app/templates/public/404.html b/railties/lib/rails/generators/rails/app/templates/public/404.html index 88ee108e90..9a48320a5f 100644 --- a/railties/lib/rails/generators/rails/app/templates/public/404.html +++ b/railties/lib/rails/generators/rails/app/templates/public/404.html @@ -1,7 +1,6 @@ - The page you were looking for doesn't exist (404)