Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 17:30: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
|
end
|
||||||
|
|
||||||
def self.remove(submission)
|
def self.remove(submission)
|
||||||
if submission.present?
|
submission.remove
|
||||||
user_id = submission.user.id
|
end
|
||||||
wizard_id = submission.wizard.id
|
|
||||||
submission_id = submission.id
|
def remove
|
||||||
|
if present?
|
||||||
|
user_id = @user.id
|
||||||
|
wizard_id = @wizard.id
|
||||||
|
submission_id = @id
|
||||||
data = PluginStore.get("#{wizard_id}_#{KEY}", user_id)
|
data = PluginStore.get("#{wizard_id}_#{KEY}", user_id)
|
||||||
data.delete_if { |sub| sub["id"] == submission_id }
|
data.delete_if { |sub| sub["id"] == submission_id }
|
||||||
PluginStore.set("#{wizard_id}_#{KEY}", user_id, data)
|
PluginStore.set("#{wizard_id}_#{KEY}", user_id, data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove
|
|
||||||
self.class.remove(self)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.cleanup_incomplete_submissions(wizard)
|
def self.cleanup_incomplete_submissions(wizard)
|
||||||
user_id = wizard.user.id
|
user_id = wizard.user.id
|
||||||
all_submissions = list(wizard, user_id: user_id)
|
all_submissions = list(wizard, user_id: user_id)
|
||||||
|
|
Laden …
In neuem Issue referenzieren