diff options
Diffstat (limited to 'railties/lib/rails')
10 files changed, 36 insertions, 20 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 6a4660bad0..67d5bac700 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -414,8 +414,14 @@ module Rails end end + # Return an array of railties respecting the order they're loaded + # and the order specified by the +railties_order+ config. + # + # While when running initializers we need engines in reverse + # order here when copying migrations from railties we need then in the same + # order as given by +railties_order+ def migration_railties # :nodoc: - (ordered_railties & railties_without_main_app).reverse + ordered_railties.flatten - [self] end protected @@ -448,11 +454,6 @@ module Rails super end - def railties_without_main_app # :nodoc: - @railties_without_main_app ||= Rails::Railtie.subclasses.map(&:instance) + - Rails::Engine.subclasses.map(&:instance) - end - # Returns the ordered railties for this application considering railties_order. def ordered_railties #:nodoc: @ordered_railties ||= begin @@ -472,13 +473,13 @@ module Rails index = order.index(:all) order[index] = all - order.reverse.flatten + order end end def railties_initializers(current) #:nodoc: initializers = [] - ordered_railties.each do |r| + ordered_railties.reverse.flatten.each do |r| if r == self initializers += current else diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index a26d41c0cf..0f4d932749 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -47,7 +47,8 @@ INFO logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDERR)) logger.level = ActiveSupport::Logger::WARN logger.warn( - "Rails Error: Unable to access log file. Please ensure that #{path} exists and is chmod 0666. " + + "Rails Error: Unable to access log file. Please ensure that #{path} exists and is writable " + + "(ie, make it writable for user and group: chmod 0664 #{path}). " + "The log level has been raised to WARN and the output directed to STDERR until the problem is fixed." ) logger diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 2c16b83f8a..786dcee007 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -93,9 +93,10 @@ module Rails # Loads and returns the entire raw configuration of database from # values stored in `config/database.yml`. def database_configuration - yaml = Pathname.new(paths["config/database"].existent.first || "") + path = paths["config/database"].existent.first + yaml = Pathname.new(path) if path - config = if yaml.exist? + config = if yaml && yaml.exist? require "yaml" require "erb" YAML.load(ERB.new(yaml.read).result) || {} @@ -104,7 +105,7 @@ module Rails # by Active Record. {} else - raise "Could not load database configuration. No such file - #{yaml}" + raise "Could not load database configuration. No such file - #{paths["config/database"].instance_variable_get(:@paths)}" end config diff --git a/railties/lib/rails/gem_version.rb b/railties/lib/rails/gem_version.rb index c7397c4f15..672b78c599 100644 --- a/railties/lib/rails/gem_version.rb +++ b/railties/lib/rails/gem_version.rb @@ -8,7 +8,7 @@ module Rails MAJOR = 4 MINOR = 2 TINY = 0 - PRE = "alpha" + PRE = "beta1" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index b3a67266f7..1cdad09391 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -281,8 +281,14 @@ module Rails [] else gems = [coffee_gemfile_entry, javascript_runtime_gemfile_entry] - gems << GemfileEntry.version("#{options[:javascript]}-rails", nil, - "Use #{options[:javascript]} as the JavaScript library") + + if options[:javascript] == 'jquery' + gems << GemfileEntry.version('jquery-rails', '~> 4.0.0.beta2', + 'Use jQuery as the JavaScript library') + else + gems << GemfileEntry.version("#{options[:javascript]}-rails", nil, + "Use #{options[:javascript]} as the JavaScript library") + end gems << GemfileEntry.version("turbolinks", nil, "Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks") diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 72143301a6..7b1a6aa854 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -33,8 +33,8 @@ group :development, :test do gem 'byebug' <%- end -%> - # Access an IRB console on exceptions page and /console in development - gem 'web-console', '~> 2.0.0.beta2' + # Access an IRB console on exception pages or by using <%%= console %> in views + gem 'web-console', github: 'rails/web-console', branch: 'master' <%- if spring_install? %> # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' 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 80393a16ba..9445c2454e 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -33,7 +33,7 @@ module <%= app_const_base %> # config.i18n.default_locale = :de <%- unless options.skip_active_record? -%> - # For not swallow errors in after_commit/after_rollback callbacks. + # Do not swallow errors in after_commit/after_rollback callbacks. config.active_record.raise_in_transactional_callbacks = true <%- end -%> end diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index 053f5b66d7..32756eb88b 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -31,6 +31,9 @@ Rails.application.configure do # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + # Randomize the order test cases are executed + config.active_support.test_order = :random + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr diff --git a/railties/lib/rails/generators/test_unit/job/templates/unit_test.rb.erb b/railties/lib/rails/generators/test_unit/job/templates/unit_test.rb.erb index 6200218313..f5351d0ec6 100644 --- a/railties/lib/rails/generators/test_unit/job/templates/unit_test.rb.erb +++ b/railties/lib/rails/generators/test_unit/job/templates/unit_test.rb.erb @@ -1,7 +1,7 @@ require 'test_helper' <% module_namespacing do -%> -class <%= class_name %>JobTest < ActiveSupport::TestCase +class <%= class_name %>JobTest < ActiveJob::TestCase # test "the truth" do # assert true # end diff --git a/railties/lib/rails/templates/rails/mailers/email.html.erb b/railties/lib/rails/templates/rails/mailers/email.html.erb index 977feb922b..1dc1d70f8d 100644 --- a/railties/lib/rails/templates/rails/mailers/email.html.erb +++ b/railties/lib/rails/templates/rails/mailers/email.html.erb @@ -2,6 +2,10 @@ <html><head> <meta name="viewport" content="width=device-width" /> <style type="text/css"> + body { + margin: 0; + } + header { width: 100%; padding: 10px 0 0 0; @@ -95,4 +99,4 @@ <iframe seamless name="messageBody" src="?part=<%= Rack::Utils.escape(@part.mime_type) %>"></iframe> </body> -</html>
\ No newline at end of file +</html> |