# 是否有覆盖用户名限制的选项？

**URL:** <https://meta.discourse.org/t/any-options-for-over-riding-the-username-restrictions/96356>\
**Category:** Support\
**Created:** [2018年九月4日 21:15 UTC](https://meta.discourse.org/t/any-options-for-over-riding-the-username-restrictions/96356 "2018-09-04T21:15:02Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)\
**Post date:** [2018年九月5日 21:30 UTC](https://meta.discourse.org/t/any-options-for-over-riding-the-username-restrictions/96356/12 "2018-09-05T21:30:15Z")

</div>

Have I got a topic for you!

> [@Override existing Discourse methods in plugins](https://meta.discourse.org/t/tips-for-overriding-existing-discourse-methods-in-plugins/83389):
>
> I’ve been running into a bunch of instances recently of needing to override existing ruby methods from plugins, and thought I’d share my best practices here. Overriding an instance method class ::TopicQuery module BabbleDefaultResults def default\_results(options={}) super(options).where('archetype \<\> ?', Archetype.chat) end end prepend BabbleDefaultResults end Here I’m removing chat topics from an instance method which is returning a list of topics. The module name BabbleD…

---

_[View the full topic](https://meta.discourse.org/t/any-options-for-over-riding-the-username-restrictions/96356)._
