Created
September 10, 2010 17:14
-
-
Save mikz/574015 to your computer and use it in GitHub Desktop.
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
def quoted_date(value) | |
if value.acts_like?(:time) && value.respond_to?(:usec) | |
begin | |
"#{value.getutc.to_s(:db)}.#{sprintf("%06d", value.usec)} #{value.formatted_offset}" | |
rescue | |
"#{super}.#{sprintf("%06d", value.usec)}" | |
end | |
else | |
super | |
end | |
end |
AccessKey expired
I don't understand. AccessKey for what? The link to the original patch I posted?
By the way, here is my final revision to your (this) gist: http://gist.github.com/574080
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't like the rescue clause here (exceptions are not meant to replace if-statements) and the sprintf() call can be DRYed up. See my original patch for an example of these things:
http://s3.amazonaws.com/activereload-lighthouse/assets/d66895a49d1f4088200b8bc17b8127f1504be139/0001-postgresql_adapter-Include-time-zone-in-result-of-q.patch?AWSAccessKeyId=1AJ9W2TX1B2Z7C2KYB82&Expires=1284141301&Signature=K4F%2BRrtjwwE3Dyxo9PFRvZfVICg%3D