Ticket #10570: change_application_to_application_controller2.2.diff
| File change_application_to_application_controller2.2.diff, 7.7 kB (added by jaycfields, 10 months ago) |
|---|
-
activesupport/test/dependencies_test.rb
old new 446 446 447 447 def test_application_should_special_case_application_controller 448 448 with_loading 'autoloading_fixtures' do 449 require_dependency 'application'450 449 assert_equal 10, ApplicationController 451 450 assert Dependencies.autoloaded?(:ApplicationController) 452 451 end -
activesupport/test/autoloading_fixtures/application.rb
old new -
activesupport/test/autoloading_fixtures/application_controller.rb
old new -
activesupport/lib/active_support/dependencies.rb
old new 142 142 next if nesting.blank? 143 143 144 144 [ 145 nesting.camelize, 146 # Special case: application.rb might define ApplicationControlller. 147 ('ApplicationController' if nesting == 'application') 145 nesting.camelize 148 146 ] 149 147 end.flatten.compact.uniq 150 148 end -
actionpack/lib/action_controller/dispatcher.rb
old new 137 137 end 138 138 139 139 def prepare_application(force = false) 140 begin141 require_dependency 'application' unless defined?(::ApplicationController)142 rescue LoadError => error143 raise unless error.message =~ /application\.rb/144 end145 146 140 ActiveRecord::Base.verify_active_connections! if defined?(ActiveRecord) 147 141 148 142 if unprepared || force -
railties/test/initializer_test.rb
old new 136 136 end 137 137 end 138 138 139 uses_mocha "Checking application.rb tests" do 140 class Initializer_check_application_file_name_Test < Test::Unit::TestCase 141 def test_abort_if_application_file_exists 142 Rails::Initializer.any_instance.expects(:abort) 143 File.expects(:exist?).returns true 144 Rails::Initializer.run(:check_application_file_name) 145 end 146 147 def test_no_abort_if_application_file_does_not_exist 148 Rails::Initializer.any_instance.expects(:abort).never 149 File.expects(:exist?).returns false 150 Rails::Initializer.run(:check_application_file_name) 151 end 152 end 153 end 154 139 155 uses_mocha "Initializer plugin loading tests" do 140 156 require File.dirname(__FILE__) + '/plugin_test_helper' 141 157 -
railties/helpers/application.rb
old new 1 # Filters added to this controller apply to all controllers in the application.2 # Likewise, all the methods added will be available for all controllers.3 4 class ApplicationController < ActionController::Base5 helper :all # include all helpers, all the time6 7 # See ActionController::RequestForgeryProtection for details8 # Uncomment the :secret if you're not using the cookie session store9 protect_from_forgery # :secret => '<%= app_secret %>'10 end -
railties/helpers/application_controller.rb
old new 1 # Filters added to this controller apply to all controllers in the application. 2 # Likewise, all the methods added will be available for all controllers. 3 4 class ApplicationController < ActionController::Base 5 helper :all # include all helpers, all the time 6 7 # See ActionController::RequestForgeryProtection for details 8 # Uncomment the :secret if you're not using the cookie session store 9 protect_from_forgery # :secret => '<%= app_secret %>' 10 end -
railties/lib/rails_generator/generators/applications/app/app_generator.rb
old new 47 47 m.file "README", "README" 48 48 49 49 # Application 50 m.template "helpers/application .rb", "app/controllers/application.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest }50 m.template "helpers/application_controller.rb", "app/controllers/application_controller.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest } 51 51 m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb" 52 52 m.template "helpers/test_helper.rb", "test/test_helper.rb" 53 53 -
railties/lib/console_with_helpers.rb
old new 16 16 end 17 17 end 18 18 19 require 'application'20 21 19 class << helper 22 20 include_all_modules_from ActionView 23 21 end -
railties/lib/initializer.rb
old new 61 61 # in order: 62 62 # 63 63 # * #check_ruby_version 64 # * #check_application_file_name 64 65 # * #set_load_path 65 66 # * #require_frameworks 66 67 # * #set_autoload_paths … … 83 84 # * #load_application_initializers 84 85 def process 85 86 check_ruby_version 87 check_application_file_name 86 88 set_load_path 87 89 88 90 require_frameworks … … 123 125 require 'ruby_version_check' 124 126 end 125 127 128 # Check for application.rb and suggest rename if it exists 129 def check_application_file_name 130 abort 'Please rename app/controllers/application.rb to app/controllers/application_controller.rb' if File.exist?("#{RAILS_ROOT}/app/controllers/application.rb") 131 end 132 126 133 # Set the <tt>$LOAD_PATH</tt> based on the value of 127 134 # Configuration#load_paths. Duplicates are removed. 128 135 def set_load_path -
railties/lib/test_help.rb
old new 1 require_dependency 'application'2 3 1 # Make double-sure the RAILS_ENV is set to test, 4 2 # so fixtures are loaded to the right database 5 3 silence_warnings { RAILS_ENV = "test" } -
railties/lib/commands/performance/request.rb
old new 1 1 #!/usr/bin/env ruby 2 2 require 'config/environment' 3 require 'application'4 3 require 'action_controller/request_profiler' 5 4 6 5 ActionController::RequestProfiler.run(ARGV)