Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
FIX: use class method as alias for instance method
Dieser Commit ist enthalten in:
Ursprung
e260241dea
Commit
1916335fa9
1 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen
|
@ -98,20 +98,20 @@ class CustomWizard::Submission
|
|||
end
|
||||
|
||||
def self.remove(submission)
|
||||
if submission.present?
|
||||
user_id = submission.user.id
|
||||
wizard_id = submission.wizard.id
|
||||
submission_id = submission.id
|
||||
submission.remove
|
||||
end
|
||||
|
||||
def remove
|
||||
if present?
|
||||
user_id = @user.id
|
||||
wizard_id = @wizard.id
|
||||
submission_id = @id
|
||||
data = PluginStore.get("#{wizard_id}_#{KEY}", user_id)
|
||||
data.delete_if { |sub| sub["id"] == submission_id }
|
||||
PluginStore.set("#{wizard_id}_#{KEY}", user_id, data)
|
||||
end
|
||||
end
|
||||
|
||||
def remove
|
||||
self.class.remove(self)
|
||||
end
|
||||
|
||||
def self.cleanup_incomplete_submissions(wizard)
|
||||
user_id = wizard.user.id
|
||||
all_submissions = list(wizard, user_id: user_id)
|
||||
|
|
Laden …
In neuem Issue referenzieren