Created
April 8, 2014 03:30
-
-
Save johnnaegle/10087469 to your computer and use it in GitHub Desktop.
Monkey Patches ActiveSupport::TimeWithZone for Rails 4.0 to be backwards compatible with Rails 3.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveSupport | |
class TimeWithZone | |
def as_json(options = nil) | |
if ActiveSupport::JSON::Encoding.use_standard_json_time_format | |
xmlschema | |
else | |
%(#{time.strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment