1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/controllers/staffs/relation_statuses_controller.rb

27 lines
658 B
Ruby

# frozen_string_literal: true
class Staffs::RelationStatusesController < ApplicationController
include PaginalController
before_action :set_relation_status, only: :show
# GET /staff/relation_statuses
def index
authorize [:staff, RelationStatus]
@relation_statuses = policy_scope(
RelationStatus.order(codename: :asc),
policy_scope_class: Staff::RelationStatusPolicy::Scope,
).page(active_page)
end
# GET /staff/relation_statuses/:codename
def show
authorize [:staff, @relation_status]
end
private
def set_relation_status
@relation_status = RelationStatus.find_by! codename: params[:codename]
end
end