提交 d338a0fe 编写于 作者: V Vipul A M

MOAR cleanups.

上级 a3c8e4ad
......@@ -49,7 +49,7 @@ class Railtie < Rails::Railtie # :nodoc:
Rails.logger.extend ActiveSupport::Logger.broadcast console
end
runner do |app|
runner do
require "active_record/base"
end
......@@ -64,7 +64,7 @@ class Railtie < Rails::Railtie # :nodoc:
ActiveSupport.on_load(:active_record) { self.logger ||= ::Rails.logger }
end
initializer "active_record.migration_error" do |app|
initializer "active_record.migration_error" do
if config.active_record.delete(:migration_error) == :page_load
config.app_middleware.insert_after "::ActionDispatch::Callbacks",
"ActiveRecord::Migration::CheckPending"
......@@ -158,7 +158,7 @@ class Railtie < Rails::Railtie # :nodoc:
end
# Expose database runtime to controller for logging.
initializer "active_record.log_runtime" do |app|
initializer "active_record.log_runtime" do
require "active_record/railties/controller_runtime"
ActiveSupport.on_load(:action_controller) do
include ActiveRecord::Railties::ControllerRuntime
......
......@@ -84,7 +84,6 @@ def test_activerecord_model
assert_nothing_raised { x.save }
assert_nothing_raised { Group.find_by_order('y') }
assert_nothing_raised { Group.find(1) }
x = Group.find(1)
end
# has_one association with reserved-word table name
......
......@@ -95,7 +95,7 @@ def test_should_construct_new_finder_sql_after_create
def test_force_reload
firm = Firm.new("name" => "A New Firm, Inc")
firm.save
firm.clients.each {|c|} # forcing to load all clients
firm.clients.each {} # forcing to load all clients
assert firm.clients.empty?, "New firm shouldn't have client objects"
assert_equal 0, firm.clients.size, "New firm should have 0 clients"
......
......@@ -185,7 +185,7 @@ def test_checkout_behaviour
assert_not_nil connection
threads = []
4.times do |i|
threads << Thread.new(i) do |pool_count|
threads << Thread.new(i) do
connection = pool.connection
assert_not_nil connection
connection.close
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册