Skip to content

timestamps are absent when using limit within include #4740

@bestan

Description

@bestan

I noticed that timestamps are not passed to the instance when using limit within include (version 3.12.2, postgres).

Example that reproduces the issue:

var Parent = sequelize.define('parent');
var Child = sequelize.define('child');
Parent.hasMany(Child);

//Sync etc.

Parent.create({
  children: [{
    id: 1
  }],
}, {
  include: [Child]
}).then(function(parent) {

  Parent.findAll({
    limit: 5,
    include: [{
      model: Child,
      limit: 5 //Removing limit brings 'created_at' back
    }]
  }).then(function(parents) {
    console.log(parents[0].children[0].created_at); //this is undefined when limit is specified
  });
});

Anything I'm doing wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions