aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2010-01-03 19:20:43 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2010-01-03 19:20:43 -0800
commit6042067c0b20602e72954450e9e8a19dfa8a9f7d (patch)
treeaff2dae32a7253c9cd61679f7b5d91797bd4be8e /activesupport/lib
parent532b11690fa2c4fd2c127ddc7df246c4469ebbc4 (diff)
downloadrails-6042067c0b20602e72954450e9e8a19dfa8a9f7d.tar.gz
rails-6042067c0b20602e72954450e9e8a19dfa8a9f7d.tar.bz2
rails-6042067c0b20602e72954450e9e8a19dfa8a9f7d.zip
Changed the default ActiveSupport.use_standard_json_time_format from false to true and
ActiveSupport.escape_html_entities_in_json from true to false to match previously announced Rails 3 defaults [DHH]
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/json/encoding.rb3
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb7
2 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb
index c8415d5449..8ba45f7ea2 100644
--- a/activesupport/lib/active_support/json/encoding.rb
+++ b/activesupport/lib/active_support/json/encoding.rb
@@ -114,7 +114,8 @@ module ActiveSupport
end
end
- self.escape_html_entities_in_json = true
+ self.use_standard_json_time_format = true
+ self.escape_html_entities_in_json = false
end
CircularReferenceError = Deprecation::DeprecatedConstantProxy.new('ActiveSupport::JSON::CircularReferenceError', Encoding::CircularReferenceError)
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 6b554e7158..710dce78de 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -32,7 +32,6 @@ module ActiveSupport
# t.is_a?(Time) # => true
# t.is_a?(ActiveSupport::TimeWithZone) # => true
class TimeWithZone
-
def self.name
'Time' # Report class name as 'Time' to thwart type checking
end
@@ -114,9 +113,9 @@ module ActiveSupport
end
alias_method :iso8601, :xmlschema
- # Coerces the date to a string for JSON encoding.
- #
- # ISO 8601 format is used if ActiveSupport::JSON::Encoding.use_standard_json_time_format is set.
+ # Coerces the date to a string for JSON encoding. The default format is ISO 8601. You can get
+ # %Y/%m/%d %H:%M:%S +offset style by setting ActiveSupport::JSON::Encoding.use_standard_json_time_format
+ # to false.
#
# ==== Examples
#