mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
Add reloadable support for patching in an avatar lookup
This commit is contained in:
parent
64bb0f9f05
commit
e7885c20cb
1 changed files with 7 additions and 0 deletions
|
@ -96,6 +96,13 @@ class Plugin::Instance
|
|||
end
|
||||
end
|
||||
|
||||
def custom_avatar_column(column)
|
||||
reloadable_patch do |plugin|
|
||||
AvatarLookup.lookup_columns << column
|
||||
AvatarLookup.lookup_columns.uniq!
|
||||
end
|
||||
end
|
||||
|
||||
# Extend a class but check that the plugin is enabled
|
||||
# for class methods use `add_class_method`
|
||||
def add_to_class(class_name, attr, &block)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue