New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error "DateTime is not currently supported" when saving edited document #48

Closed
jan-harmsen opened this Issue Oct 24, 2012 · 13 comments

Comments

Projects
None yet
2 participants
@jan-harmsen

steps to reproduce (genghis version 2.1.2 with MongoDB v2.2.1-rc0):

  1. display a document containing at least one DateTime
  2. start editing document (not modifying any DateTime)
  3. save document (triggering PUT)

document does not get saved, Firebug shows error with status code 500:

{
"error":"DateTime is not currently supported; use a UTC Time instance instead.",
"status":500
}

and rails console reports:

BSON::InvalidDocument - DateTime is not currently supported; use a UTC Time instance instead.: .../gems/bson-1.7.0/lib/bson/bson_c.rb:24:in serialize' ..... /gems/genghisapp-2.1.2/genghis.rb:245:inupdate'

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Oct 24, 2012

Owner

I'll look into this later this afternoon. In the meantime, what versions of the following are you using:

  • genghisapp gem
  • bson_ext gem
  • mongo gem
  • ruby

Thanks!

Owner

bobthecow commented Oct 24, 2012

I'll look into this later this afternoon. In the meantime, what versions of the following are you using:

  • genghisapp gem
  • bson_ext gem
  • mongo gem
  • ruby

Thanks!

@jan-harmsen

This comment has been minimized.

Show comment
Hide comment
@jan-harmsen

jan-harmsen Oct 24, 2012

  • genghisapp (2.1.2)
  • bson_ext (1.7.0)
  • mongo (1.7.0)
  • ruby 1.9.3-p286

No hurry, take your time, you've created a really nice utility app!

  • genghisapp (2.1.2)
  • bson_ext (1.7.0)
  • mongo (1.7.0)
  • ruby 1.9.3-p286

No hurry, take your time, you've created a really nice utility app!

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Oct 27, 2012

Owner

I'm unable to reproduce this with MongoDB v2.2.0 (and all the other versions you list). I'll try to get v2.2.1-rc0 running and see if I can reproduce it there.

Curious: does it happen when you run Genghis as a standalone app, or only when mounted under Rails? Try running genghisapp and see whether that has the same problem.

Owner

bobthecow commented Oct 27, 2012

I'm unable to reproduce this with MongoDB v2.2.0 (and all the other versions you list). I'll try to get v2.2.1-rc0 running and see if I can reproduce it there.

Curious: does it happen when you run Genghis as a standalone app, or only when mounted under Rails? Try running genghisapp and see whether that has the same problem.

@jan-harmsen

This comment has been minimized.

Show comment
Hide comment
@jan-harmsen

jan-harmsen Oct 29, 2012

Hi, I am able to reproduce it, behaviour is as follows:

  • editing works all the time with genghisapp
  • editing a document containing a DateTime via genghis mounted in Rails works only the first time but not the second (third etc.) time:
    When editing and saving the document the first time, the formatting changes from
doc_updated_at: ISODate("2012-10-29T17:07:37+00:00")

to

doc_updated_at: ISODate("Mon Oct 29 2012 18:07:38 GMT+0100 (CET)")

and after that it's no longer possible to save an edited document since an error is thrown (see my first posting).

Hope that helps...

Hi, I am able to reproduce it, behaviour is as follows:

  • editing works all the time with genghisapp
  • editing a document containing a DateTime via genghis mounted in Rails works only the first time but not the second (third etc.) time:
    When editing and saving the document the first time, the formatting changes from
doc_updated_at: ISODate("2012-10-29T17:07:37+00:00")

to

doc_updated_at: ISODate("Mon Oct 29 2012 18:07:38 GMT+0100 (CET)")

and after that it's no longer possible to save an edited document since an error is thrown (see my first posting).

Hope that helps...

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Oct 29, 2012

Owner

Grr. Rails must be fiddling with something. I'll try to track it down.

Owner

bobthecow commented Oct 29, 2012

Grr. Rails must be fiddling with something. I'll try to track it down.

@jan-harmsen

This comment has been minimized.

Show comment
Hide comment
@jan-harmsen

jan-harmsen Oct 29, 2012

Grrrreat, THANKS :-)

Grrrreat, THANKS :-)

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Oct 29, 2012

Owner

Got it. Something railsy is 'fixing' DateTime#to_time to return a DateTime instance instead of a Time instance. I've got a workaround, but I'm looking for a better way :-/

Owner

bobthecow commented Oct 29, 2012

Got it. Something railsy is 'fixing' DateTime#to_time to return a DateTime instance instead of a Time instance. I've got a workaround, but I'm looking for a better way :-/

@jan-harmsen

This comment has been minimized.

Show comment
Hide comment
@jan-harmsen

jan-harmsen Oct 29, 2012

that's good news, thank you very much for looking into this!

that's good news, thank you very much for looking into this!

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Oct 29, 2012

Owner

Okay. This should do it.

Do you mind checking against the develop branch and making sure it fixes things for you?

Owner

bobthecow commented Oct 29, 2012

Okay. This should do it.

Do you mind checking against the develop branch and making sure it fixes things for you?

@jan-harmsen

This comment has been minimized.

Show comment
Hide comment
@jan-harmsen

jan-harmsen Oct 29, 2012

OK, i will check tomorrow!

OK, i will check tomorrow!

@jan-harmsen

This comment has been minimized.

Show comment
Hide comment
@jan-harmsen

jan-harmsen Oct 30, 2012

OK, just tested your fix from branch 'develop': works like a charm, thanks a lot!

OK, just tested your fix from branch 'develop': works like a charm, thanks a lot!

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Oct 30, 2012

Owner

Great. Thank you for your help. This will be in the next release (coming shortly).

Owner

bobthecow commented Oct 30, 2012

Great. Thank you for your help. This will be in the next release (coming shortly).

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Nov 1, 2012

Owner

Annnd released.

Owner

bobthecow commented Nov 1, 2012

Annnd released.

@bobthecow bobthecow closed this Nov 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment