Files
redux-scraper/app/controllers/domain/fa/users_controller.rb
Dylan Knutson e931897c6c Enhance strict typing and refactor models for improved type safety
- Updated various Ruby files to enforce strict typing with Sorbet, including controllers, jobs, and models.
- Refactored method signatures across multiple classes to ensure better type checking and documentation.
- Introduced `requires_ancestor` in several modules to enforce class hierarchy requirements.
- Enhanced the `DbSampler` and `Scraper` classes with type signatures for better clarity and maintainability.
- Added new methods in the `Domain::Fa::User` class for scan management, improving functionality and type safety.

These changes aim to enhance the overall stability and maintainability of the codebase.
2025-01-01 23:14:27 +00:00

29 lines
709 B
Ruby

# typed: true
class Domain::Fa::UsersController < ApplicationController
before_action :set_ivfflat_probes!, only: %i[show]
before_action :set_user, only: %i[show]
skip_before_action :authenticate_user!, only: %i[show]
# GET /domain/fa/users or /domain/fa/users.json
def index
authorize Domain::Fa::User
@users =
policy_scope(Domain::Fa::User).includes({ avatar: [:file] }).page(
params[:page],
)
end
# GET /domain/fa/users/1 or /domain/fa/users/1.json
def show
authorize @user
end
private
# Use callbacks to share common setup or constraints between actions.
def set_user
@user = Domain::Fa::User.find_by(url_name: params[:url_name])
end
end