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
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