# “reloadable\_patch”到底是什么？

**URL:** https://meta.discourse.org/t/what-is-reloadable-patch-exactly/160247
**Category:** Development
**Created:** [2020年八月9日 11:40 UTC](https://meta.discourse.org/t/what-is-reloadable-patch-exactly/160247 "2020-08-09T11:40:00Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [2020年十一月3日 08:59 UTC](https://meta.discourse.org/t/what-is-reloadable-patch-exactly/160247/4 "2020-11-03T08:59:29Z")

</div>

@markvanlan 解释得很清楚

> [@Discourse Plugins and Rails 6 config/initializers Question](https://meta.discourse.org/t/discourse-plugins-and-rails-6-config-initializers-question/168373/20?u=fzngagan):
>
> I guess I have mislead you in posts above. reloadable\_patch is helpful for discourse development, but @david explained it’s use very well: Anything inside the after\_initialize block of plugin.rb is only loaded [during application boot](https://github.com/discourse/discourse/blob/5140ec9acf29df220ec00cc6a704b73773a86bdc/config/application.rb#L342-L342), and not on subsequent reloads. So, assuming you want to add something to the user serializer. The normal behavior would be like: At boot: Discourse loads user\_serializer.rb Discourse loads plugin.rb , which has an override for user\_serializer At reload: …

---

_[View the full topic](https://meta.discourse.org/t/what-is-reloadable-patch-exactly/160247)._
