提交 a12bb714 编写于 作者: E Emilio Tagua

"there is no need to store this option just for initialization" José Valim dixit.

上级 72aa6f4f
......@@ -411,10 +411,6 @@ class Base
class_attribute :store_full_sti_class
self.store_full_sti_class = true
# Determine whether or not to use IdentityMap.
class_attribute :identity_map
self.identity_map = false
# Stores the default scope for the class
class_inheritable_accessor :default_scoping, :instance_writer => false
self.default_scoping = []
......
......@@ -43,6 +43,11 @@ class Railtie < Rails::Railtie
ActiveSupport.on_load(:active_record) { self.logger ||= ::Rails.logger }
end
initializer "active_record.identity_map" do |app|
config.app_middleware.insert_after "::ActionDispatch::Callbacks",
"ActiveRecord::IdentityMap::Middleware" if config.active_record.delete(:identity_map)
end
initializer "active_record.set_configs" do |app|
ActiveSupport.on_load(:active_record) do
app.config.active_record.each do |k,v|
......@@ -78,11 +83,6 @@ class Railtie < Rails::Railtie
end
end
initializer "active_record.identity_map" do |app|
config.app_middleware.insert_after "::ActionDispatch::Callbacks",
"ActiveRecord::IdentityMap::Middleware" if config.active_record.identity_map
end
config.after_initialize do
ActiveSupport.on_load(:active_record) do
instantiate_observers
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册