discourse-journal/extensions/category_custom_field.rb
angusmcleod 6a3fa08f0c version 0.2
- new sort order calculation
- new timeline
- new styles
- minor fixes
2021-07-12 20:15:39 +08:00

17 lines
378 B
Ruby

# frozen_string_literal: true
module DiscourseJournal
module CategoryCustomFieldExtension
def self.included(base)
base.after_commit :update_sort_order, if: :journal_changed
end
def journal_changed
name == 'journal'
end
def update_sort_order
Jobs.enqueue(:update_journal_category_sort_order, category_id: category_id)
end
end
end