title: second level include using sequelize
body: <p>if user can have many posts and each post can have many images, does this mean that user and images are associated? because currently i am trying to show for each user there posts and for the posts i want to show the images as url and thumbnailurl using the method you stated above. i keep getting an error that Post_Image is not associated to User.</p>
  <p>I am currently trying this code and i keep getting an Error Cannot read property map.</p>
  <pre><code>router.get(&quot;/posts&quot;, auth, (req, res) =&gt; {
  
  let { id } = req.user;
  User.findByPk(id, {
   include: [
    {
      model: Post,
      include: [{ model: Post_Image, attributes: [&quot;id&quot;, &quot;images&quot;] }],
    },
  ],
  }).then((post) =&gt; {
  if (!post)
    return res.status(404).send();
  
  const baseUrl = config.get(&quot;assetsBaseUrl&quot;);
  
  const plainPost = post.get({ plain: true });
  const { Post_Images, ...postAttributes } = plainPost;
  const IMAGES = Post_Images.map((postImage) =&gt; ({
    url: `${baseUrl}${postImage.images}_full.jpg`,
    thumbnailUrl: `${baseUrl}${postImage.images}_thumb.jpg`,
  }));
  
  res.send({ ...postAttributes, images: IMAGES });
   });
   });
  </code></pre>