From 6de241be8134a2b25ef17a5418db0348df07423c Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 23 Nov 2008 14:07:43 -0800 Subject: Lazy-require builder lib --- activesupport/lib/active_support/core_ext/hash/conversions.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/hash/conversions.rb') diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb index 50dc7c61fc..a76c8a2259 100644 --- a/activesupport/lib/active_support/core_ext/hash/conversions.rb +++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb @@ -1,6 +1,5 @@ require 'date' require 'cgi' -require 'builder' require 'xmlsimple' # Locked down XmlSimple#xml_in_string @@ -113,6 +112,8 @@ module ActiveSupport #:nodoc: alias_method :to_param, :to_query def to_xml(options = {}) + require 'builder' unless defined?(Builder) + options[:indent] ||= 2 options.reverse_merge!({ :builder => Builder::XmlMarkup.new(:indent => options[:indent]), :root => "hash" }) -- cgit v1.2.3