Skip to content
Snippets Groups Projects
Commit 059823df authored by pabois's avatar pabois
Browse files

website order

parent 4e06842a
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ class Admin::Communication::WebsitesController < Admin::Communication::Applicati
load_and_authorize_resource class: Communication::Website
def index
@websites = current_university.communication_websites
@websites = current_university.communication_websites.ordered
breadcrumb
add_breadcrumb Communication::Website.model_name.human(count: 2), admin_communication_websites_path
end
......
......@@ -59,6 +59,8 @@ class Communication::Website < ApplicationRecord
after_save :publish_about_object, if: :saved_change_to_about_id?
after_save_commit :set_programs_categories!, if: -> (website) { website.about_type == 'Education::School' }
scope :ordered, -> { order(:name) }
def self.about_types
[nil, Education::School.name, Research::Journal.name]
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment