couchrest / couchrest_extended_document

Extends CouchRest with helpers and such
Apache License 2.0
24 stars 5 forks source link

timestamps! fails on Ruby 1.9.2-head #1

Closed roryfranklin closed 14 years ago

roryfranklin commented 14 years ago

I'm running Rails 3 Beta 4 on Ruby 1.9.2-head.

When adding 'timestamps!' to a CouchRest::ExtendedDocument model, saving a new document fails with the following error:

"wrong number of arguments (2 for 1)"

I tracked this down to where Time.now is called in the timestamps! method (under lib/couchrest/extended_document.rb) and changing it to Time.now.to_s fixes the issue. However, I don't know if this is a correct fix as I'm new to Ruby.

samlown commented 14 years ago

Hi rory,

This looks like a dreaded JSON 1.4.X bug! Can you try uninstalling all traces of json 1.4, including json_pure and install the 1.2.4 version?

sudo gem install json json_pure --version=1.2.4

Cheers, sam

roryfranklin commented 14 years ago

Hi Sam,

That appears to have fixed it. Thank you.

Rory