heroku/databasedotcom — Issue #55: Undefined method 'strftime' for "Now()":String
Author: chadwtaylor
Created: 2012-02-08 04:31:16+00:00
State: open

Am using v1.3.0 and attempting to create/save a new salesforce Case record and kept on getting the error:

```ruby
case.save
#=> NoMethodError: undefined method `strftime' for "Now()":String
from /Users/johndoe/.rvm/gems/ruby-1.9.2-p290@ruckus-api/gems/databasedotcom-1.3.0/lib/databasedotcom/client.rb:501:in `block in coerced_json'
```

I went into the client.rb file as outlined in the error output on line #501 and edited the "datetime" switch/case statement where it would have a rescue; and it worked. Here's what my small fix looked like - you can fix it however you see fit:

```ruby
# databasedotcom/client.rb; line 501
when "datetime"
coerced_attrs[key] = (attrs[key] ? attrs[key].strftime(RUBY_VERSION.match(/^1.8/) ? "%Y-%m-%dT%H:%M:%S.000%z" : "%Y-%m-%dT%H:%M:%S.%L%z") : nil) rescue nil
```