提交 e1490d4e 编写于 作者: Y Yehuda Katz

Change config implementation in AV slightly

上级 02b76862
......@@ -20,7 +20,7 @@
ActionView::Template.register_template_handler :haml, lambda { |template| "Look its HAML!".inspect }
ActionView::Template.register_template_handler :bak, lambda { |template| "Lame backup".inspect }
ActionView::Base.config = { :assets_dir => '/nowhere' }
ActionView::Base::DEFAULT_CONFIG = { :assets_dir => '/nowhere' }
$:.unshift "#{File.dirname(__FILE__)}/fixtures/helpers"
......
......@@ -167,7 +167,16 @@ class Base
module Subclasses
end
include Helpers, Rendering, Partials, ::ERB::Util, ActiveSupport::Configurable
include Helpers, Rendering, Partials, ::ERB::Util
def config
self.config = DEFAULT_CONFIG unless @config
@config
end
def config=(config)
@config = ActiveSupport::OrderedOptions.new.merge(config)
end
extend ActiveSupport::Memoizable
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册