From ca9a7cec80153fd71ecb6c280ebe6475eb719027 Mon Sep 17 00:00:00 2001 From: beawesomeinstead Date: Tue, 2 Feb 2010 11:28:53 +0200 Subject: [PATCH] Moved default_form_builder accessor definition from action_view/helpers/form_helper.rb to action_view/base.rb. --- actionpack/lib/action_view/base.rb | 16 ++++++++++++++++ actionpack/lib/action_view/helpers/form_helper.rb | 18 ------------------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 4096c29..d216ecd 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -24,6 +24,9 @@ module ActionView #:nodoc: end end + mattr_accessor :default_form_builder + self.default_form_builder = ::ActionView::Helpers::FormBuilder + # Action View templates can be written in three ways. If the template file has a .erb (or .rhtml) extension then it uses a mixture of ERb # (included in Ruby) and HTML. If the template file has a .builder (or .rxml) extension then Jim Weirich's Builder::XmlMarkup library is used. # If the template file has a .rjs extension then it will use ActionView::Helpers::PrototypeHelper::JavaScriptGenerator. @@ -217,6 +220,19 @@ module ActionView #:nodoc: @@cache_template_loading = nil cattr_accessor :cache_template_loading + # 2.3 compatibility + class << self + def default_form_builder=(builder) + ActionView.default_form_builder = builder + ActiveSupport::Deprecation.warn("ActionView::Base.default_form_builder has been deprecated and will be removed in Rails 3.1. Use ActionView.default_form_builder instead", caller) + end + + def default_form_builder + ActionView.default_form_builder + ActiveSupport::Deprecation.warn("ActionView::Base.default_form_builder has been deprecated and will be removed in Rails 3.1. Use ActionView.default_form_builder instead", caller) + end + end + # :nodoc: def self.xss_safe? true diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 76998a6..dc74c8a 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -1207,22 +1207,4 @@ module ActionView end end end - - class << ActionView - attr_accessor :default_form_builder - end - - self.default_form_builder = ::ActionView::Helpers::FormBuilder - - # 2.3 compatibility - class << Base - def default_form_builder=(builder) - ActionView.default_form_builder = builder - end - - def default_form_builder - ActionView.default_form_builder - end - end - end -- 1.6.3.3