Skip to content

created_at and updated_at returns as string on first() but mongodate on create() #86

Closed
@bitinn

Description

@bitinn

we ran into this while writing a test to compare the object inserted with create and the object retrieved via get, this particular difference show up:

Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
         'parent' => Array (...)
-        'updated_at' => MongoDate Object (...)
-        'created_at' => MongoDate Object (...)
+        'updated_at' => '2013-12-11 10:01:12'
+        'created_at' => '2013-12-11 10:01:12'
     )
     'original' => Array (
         'slug' => 'test.duplicate'
         'parent' => Array (...)
-        'updated_at' => MongoDate Object (...)
-        'created_at' => MongoDate Object (...)
+        'updated_at' => '2013-12-11 10:01:12'
+        'created_at' => '2013-12-11 10:01:12'
     )

it seems create return them as MongoDate while first return them as string.

Is this an issue with laravel? or can we do something to avoid this behaviour? we are using laravel 4.0.x codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions