2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

FEATURE: Allow complex post params from plugin (#8598)

This commit is contained in:
Mark VanLandingham 2019-12-20 10:37:12 -06:00 committed by GitHub
parent 1e4a83cc2a
commit 6ec3d42b16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 69 additions and 4 deletions

View file

@ -250,9 +250,9 @@ class Plugin::Instance
end
# Add a permitted_create_param to Post, respecting if the plugin is enabled
def add_permitted_post_create_param(name)
def add_permitted_post_create_param(name, type = :string)
reloadable_patch do |plugin|
::Post.plugin_permitted_create_params[name] = plugin
::Post.plugin_permitted_create_params[name] = { plugin: plugin, type: type }
end
end