不要怂,就是干,撸起袖子干!

Commit 4cd0fc9c by Mick Hansen

Merge pull request #1856 from pola88/problem_with_timestamps

Problem with created_at and updated_at
2 parents 7c8bf549 82f6ec36
...@@ -260,8 +260,7 @@ module.exports = (function() { ...@@ -260,8 +260,7 @@ module.exports = (function() {
, mainDao; , mainDao;
delete result[this.options.joinTableModel.name]; delete result[this.options.joinTableModel.name];
mainDao = this.callee.build(result, { isNewRecord: false, isDirty: false, raw: true });
mainDao = this.callee.build(result, { isNewRecord: false, isDirty: false });
mainDao[this.options.joinTableModel.name] = joinTableDAO; mainDao[this.options.joinTableModel.name] = joinTableDAO;
return mainDao; return mainDao;
......
...@@ -750,6 +750,17 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -750,6 +750,17 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
}) })
}) })
it('gets all associated objects with all fields', function(done) {
this.User.find({where: {username: 'John'}}).success(function (john) {
john.getTasks().success(function (tasks) {
tasks[0].attributes.forEach(function(attr) {
expect(tasks[0]).to.have.property(attr)
})
done()
})
})
})
it("gets all associated objects when no options are passed", function(done) { it("gets all associated objects when no options are passed", function(done) {
this.User.find({where: {username: 'John'}}).success(function (john) { this.User.find({where: {username: 'John'}}).success(function (john) {
john.getTasks().success(function (tasks) { john.getTasks().success(function (tasks) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!