Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Using SQL ORMs with Node.js Defining Models Use Options to Adjust Models

Noah Schade
Noah Schade
17,694 Points

I believe there is a mistake with the code shown in the instruction

On the page, the code is written like this:

module.exports = (sequelize) => {
  class Movie extends Sequelize.Model {}
  Movie.init({
    // Attributes object
    id: {
      type: Sequelize.INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    ...
  }, 
  // Model options object
  { 
    timestamps: false, // disable timestamps
    sequelize 
  }

  return Movie;
});

But this does not work for me.

I used this:

module.exports = (sequelize) => {
  class Movie extends Sequelize.Model {}
  Movie.init({
    // Attributes object
    id: {
      type: Sequelize.INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    ...
  }, { 
    timestamps: false, // disable timestamps
    sequelize 
  });

  return Movie;
};

And this works for me. Am I doing something wrong?

1 Answer

John Nguyen
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
John Nguyen
Full Stack JavaScript Techdegree Graduate 30,501 Points

Hi Noah,

This is because they added an ellipsis (...) to some of their code snippets to omit content. This appears to have been intentional because the new concept/idea might be tough to notice if they continue to show the entire code snippet.

I hope that helps!