discourse/app/controllers/admin/plugins_controller.rb
Martin Brennan 194c84b217
FIX: Sort plugin list by name properly (#24839)
Some plugins have discourse- prefixed on their name
and some don't, so sorting in the list was inconsistent.

---------

Co-authored-by: Ted Johansson <ted@discourse.org>
2023-12-18 11:42:55 +10:00

12 lines
283 B
Ruby

# frozen_string_literal: true
class Admin::PluginsController < Admin::StaffController
def index
render_serialized(
Discourse.visible_plugins.sort_by { |p| p.name.downcase.delete_prefix("discourse-") },
AdminPluginSerializer,
root: "plugins",
)
end
end