# The Plugin::Instance.find\_all method incorrectly treats every file with the «plugin.rb» name as a Discourse plugin

**URL:** <https://meta.discourse.org/t/the-plugin-instance-find-all-method-incorrectly-treats-every-file-with-the-plugin-rb-name-as-a-discourse-plugin/54462>\
**Category:** Bug\
**Created:** [Dezembro 19, 2016, 12:21am UTC](https://meta.discourse.org/t/the-plugin-instance-find-all-method-incorrectly-treats-every-file-with-the-plugin-rb-name-as-a-discourse-plugin/54462 "2016-12-19T00:21:09Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)\
**Post date:** [Dezembro 19, 2016, 12:32am UTC](https://meta.discourse.org/t/the-plugin-instance-find-all-method-incorrectly-treats-every-file-with-the-plugin-rb-name-as-a-discourse-plugin/54462/3 "2016-12-19T00:32:17Z")

</div>

Moreover, looks like the buggy code is also unefficient, because it searches for the «plugin.rb» files in all the filesystem tree inside the «plugins» directory, despite the Discourse’s «plugin.rb» files are always on the second level in this tree.

---

_[View the full topic](https://meta.discourse.org/t/the-plugin-instance-find-all-method-incorrectly-treats-every-file-with-the-plugin-rb-name-as-a-discourse-plugin/54462)._
