mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: editing a poll/post with a poll wasn't working properly
This commit is contained in:
parent
84c65aeb60
commit
151dea4088
4 changed files with 70 additions and 46 deletions
|
@ -78,12 +78,12 @@ class Plugin::Instance
|
|||
end
|
||||
|
||||
# Add validation method but check that the plugin is enabled
|
||||
def validate(klass, attr, &block)
|
||||
def validate(klass, name, &block)
|
||||
klass = klass.to_s.classify.constantize
|
||||
klass.send(:define_method, attr, &block)
|
||||
klass.send(:define_method, name, &block)
|
||||
|
||||
plugin = self
|
||||
klass.validate(attr, if: -> { plugin.enabled? })
|
||||
klass.validate(name, if: -> { plugin.enabled? })
|
||||
end
|
||||
|
||||
# will make sure all the assets this plugin needs are registered
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue