chore: init commit

in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
2026-08-11 14:44:09 -04:00
parent 0012380fd3
commit 392781f7aa
781 changed files with 65944 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# frozen_string_literal: true
# Base controller for in-house admin.
# All Admin controllers inherit from this controller.
module Admin
class BaseController < ApplicationController
layout "admin"
before_action :authenticate_admin
private
def authenticate_admin
redirect_to root_path, alert: t("application.access_denied.admin_required") unless current_user&.admin?
end
# Apply sorting to a collection based on params
# @param collection [ActiveRecord::Relation] The base collection to sort
# @param default [String] The default column to sort by
# @return [ActiveRecord::Relation] The sorted collection
def apply_sorting(collection, default:)
sort_column = params[:sort].presence || default
sort_direction = params[:direction] == "desc" ? :desc : :asc
collection.reorder(sort_column => sort_direction)
end
end
end