aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/hash
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-11-23 14:07:43 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2008-11-23 15:05:57 -0800
commit6de241be8134a2b25ef17a5418db0348df07423c (patch)
treec1e05b34e527e8e3596ba3637212092c36dc8f47 /activesupport/lib/active_support/core_ext/hash
parent31ce92f7b5784bc5b6a441e88cd734c7b8b1c58f (diff)
downloadrails-6de241be8134a2b25ef17a5418db0348df07423c.tar.gz
rails-6de241be8134a2b25ef17a5418db0348df07423c.tar.bz2
rails-6de241be8134a2b25ef17a5418db0348df07423c.zip
Lazy-require builder lib
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb3
1 files changed, 2 insertions, 1 deletions
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" })