Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Bulk save of extended docs with timestamps! does not save created_at or updated_at fields

#42

Reported by grempe on github

When a model is created that extends Couchrest::ExtendedDocument and it has the 'timestamps!' property in the model it is expected that a 'created_at' and 'updated_at' timestamp field will be created when the document is saved. It should not matter if the document was saved singly or using the bulk save mechanism.

This only works as expected when docs are created and saved singly. Bulk document saves do not create the expected fields.

Please find an example of this at : http://pastie.org/652473

The example first shows creating and saving an individual doc with timestamps created properly. The second part shows creating multiple docs and bulk saving them with no timestamps created after save.

Reported by Marcos Tapajós · October 19th, 2009 @ 09:28 AM

State: new
Milestone: none
Assigned to: nobody

Activity

  1. Marcos Tapajós
    Marcos Tapajós

    Timestamp! is a feature of Couchrest::ExtendedDocument. Is is a method of that create two properties and setup some callbacks. Your problem is that you are using the bulk_save of CouchRest::Database and not an ExtendedDocument.

    Maybe the correct is implement a bulk save on Couchrest::ExtendedDocument. Well, it isn't a bug.

    I can't close this ticket but for me it is closed because it isn't a bug.

    October 19th, 2009 @ 10:47 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.