Permalink
Browse files

Simpler and clearer to just explicitly require the JSON encoders

  • Loading branch information...
1 parent 44216d5 commit 6599dd907f87875045005c3754fc7fe75c130c3e @jeremy jeremy committed Nov 26, 2008
Showing with 15 additions and 9 deletions.
  1. +15 −9 activesupport/lib/active_support/json/encoding.rb
@@ -1,12 +1,3 @@
-require 'active_support/json/variable'
-require 'active_support/json/encoders/object' # Require explicitly for rdoc.
-Dir["#{File.dirname(__FILE__)}/encoders/**/*.rb"].each do |file|
- basename = File.basename(file, '.rb')
- unless basename == 'object'
- require "active_support/json/encoders/#{basename}"
- end
-end
-
module ActiveSupport
module JSON
class CircularReferenceError < StandardError
@@ -23,3 +14,18 @@ def self.encode(value, options = {})
end
end
end
+
+require 'active_support/json/variable'
+require 'active_support/json/encoders/date'
+require 'active_support/json/encoders/date_time'
+require 'active_support/json/encoders/enumerable'
+require 'active_support/json/encoders/false_class'
+require 'active_support/json/encoders/hash'
+require 'active_support/json/encoders/nil_class'
+require 'active_support/json/encoders/numeric'
+require 'active_support/json/encoders/object'
+require 'active_support/json/encoders/regexp'
+require 'active_support/json/encoders/string'
+require 'active_support/json/encoders/symbol'
+require 'active_support/json/encoders/time'
+require 'active_support/json/encoders/true_class'

0 comments on commit 6599dd9

Please sign in to comment.