Skip to content

Commit

Permalink
Change config implementation in AV slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Oct 15, 2009
1 parent 02b7686 commit e1490d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion actionmailer/test/abstract_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
11 changes: 10 additions & 1 deletion actionpack/lib/action_view/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e1490d4

Please sign in to comment.