mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 22:03:45 +08:00
d745568633
`self.class` here evaluates to `Class` and then we're calling `define_method` on it which means all classes will have those methods defined in them. For example: ``` ~/discourse(master*) » rails c Loading development environment (Rails 6.0.3.3) [1] pry(main)> Integer.methods => [:sqrt, :yaml_tag, :email_domains_blacklist=, :email_domains_whitelist=, :unicode_username_character_whitelist=, :user_website_domains_whitelist=, :whitelisted_link_domains=, :email_domains_blacklist, :email_domains_whitelist, :unicode_username_character_whitelist, ... ... ``` Fix here is to use `self.define_singleton_method`. |
||
---|---|---|
.. | ||
assets | ||
controllers | ||
helpers | ||
jobs | ||
mailers | ||
models | ||
serializers | ||
services | ||
views |