Skip to content

Commit a996a7d

Browse files
authored
Admin: Add created_at to school index record and set default ordering (#349)
Adds `created_at` field to the schools admin panel index / listing view, and sets the default order to `created_at` and `desc`. This is to make it easier for folk verifying schools to handle the process more easily by more clearly seeing new schools which have been created and require verification. The listing can still be ordered by any other field if needed (eg. name).
2 parents 28e916a + 0f4de9a commit a996a7d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

app/controllers/admin/schools_controller.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,13 @@ def reject_school
3838

3939
redirect_to admin_school_path(id: school_id)
4040
end
41+
42+
def default_sorting_attribute
43+
:created_at
44+
end
45+
46+
def default_sorting_direction
47+
:desc
48+
end
4149
end
4250
end

app/dashboards/school_dashboard.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class SchoolDashboard < Administrate::BaseDashboard
3838
name
3939
reference
4040
country_code
41+
created_at
4142
verified_at
4243
rejected_at
4344
].freeze

0 commit comments

Comments
 (0)