mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:11:12 +08:00
FIX: editing a poll/post with a poll wasn't working properly
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user