16 lines
340 B
Ruby
16 lines
340 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscourseCalendar
|
|
class CalendarDestroyer
|
|
def self.destroy(post)
|
|
fields = [
|
|
DiscourseCalendar::CALENDAR_CUSTOM_FIELD,
|
|
DiscourseCalendar::CALENDAR_DETAILS_CUSTOM_FIELD
|
|
]
|
|
|
|
PostCustomField.where(post_id: post.id, name: fields)
|
|
.delete_all
|
|
end
|
|
end
|
|
end
|