# Recently converted App to Plugin, Trouble with Associations

**URL:** <https://discourse.cakephp.org/t/recently-converted-app-to-plugin-trouble-with-associations/3045>\
**Category:** Need Help\
**Created:** [August 17, 2017, 3:48pm UTC](https://discourse.cakephp.org/t/recently-converted-app-to-plugin-trouble-with-associations/3045 "2017-08-17T15:48:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlroberts](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jlroberts/32/649_2.png) [@jlroberts](https://discourse.cakephp.org/u/jlroberts)\
**Post date:** [August 17, 2017, 3:48pm UTC](https://discourse.cakephp.org/t/recently-converted-app-to-plugin-trouble-with-associations/3045/1 "2017-08-17T15:48:14Z")

</div>

This morning I decided to convert my app to a plugin, however, I am having trouble with my Table Associations now…

Is there some dot notation or something like that I am missing when creating the `belongsTo` and `hasMany` table associations?

---

<div class="post-metadata">

**Author:** ![jlroberts](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jlroberts/32/649_2.png) [@jlroberts](https://discourse.cakephp.org/u/jlroberts)\
**Post date:** [August 17, 2017, 4:03pm UTC](https://discourse.cakephp.org/t/recently-converted-app-to-plugin-trouble-with-associations/3045/2 "2017-08-17T16:03:24Z")

</div>

I am putting a die(‘1’); statement in the

```
 public function initialize(array $config)

```

of the associated tables, but it is not firing…

---

<div class="post-metadata">

**Author:** ![ADmad](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/admad/32/20_2.png) [@ADmad](https://discourse.cakephp.org/u/ADmad)\
**Post date:** [August 20, 2017, 5:49pm UTC](https://discourse.cakephp.org/t/recently-converted-app-to-plugin-trouble-with-associations/3045/3 "2017-08-20T17:49:58Z")

</div>

Make sure you have used plugin prefix when setting up associations. E.g. If you have model `Posts` and `Comments` in your `Blog` plugin then in your `Posts::initialize()` you need to use `$this->hasMany('Blog.Comments')`.
