# 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:** [19 Diciembre, 2016 00:21 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:** 5

<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:** [19 Diciembre, 2016 05:51 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/5 "2016-12-19T05:51:20Z")

</div>

As I have checked in the Ruby debugger, the following code works correctly for both the real directories and symlinks:

```plaintext
Dir["#{parent_path}/*/plugin.rb"].sort.each do |path|

```

 ![](https://global.discourse-cdn.com/meta/original/3X/7/6/760584a958cc7aefc2cd36af5f7e7299f9da0fce.png)

---

_[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)._
