# ¿Cómo uso mi validador en el plugin?

**URL:** <https://meta.discourse.org/t/how-do-i-use-my-validator-in-the-plugin/140839>\
**Category:** Development\
**Created:** [6 Febrero, 2020 10:20 UTC](https://meta.discourse.org/t/how-do-i-use-my-validator-in-the-plugin/140839 "2020-02-06T10:20:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Dev\_Work](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dev_work/32/124200_2.png) [@Dev\_Work](https://meta.discourse.org/u/Dev_Work)\
**Post date:** [8 Febrero, 2020 15:27 UTC](https://meta.discourse.org/t/how-do-i-use-my-validator-in-the-plugin/140839/4 "2020-02-08T15:27:29Z")

</div>

¡Genial, funcionó!

Código en plugin.rb

```plaintext
def forum_require(path)
  require Rails.root.join('plugins', 'forum', 'app', path).to_s
end

after_initialize do

  forum_require 'lib/ldap_setting_validator'
//código
end

```

ldap\_setting\_validator.rb → ruta → myplugin/app/lib/ldap\_setting\_validator.rb

Gracias por el ejemplo → [babble/plugin.rb at master · gdpelican/babble · GitHub](https://github.com/gdpelican/babble/blob/master/plugin.rb#L17-L52)

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-use-my-validator-in-the-plugin/140839)._
