Skip to content

Commit

Permalink
Update registers_controller.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Feb 13, 2025
1 parent 13bc39b commit 1efbb65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/registers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def index(status = :validated)
# GET /registers/r:abcd
# GET /registers/r:abcd.json
def show
@register.update_name_order if @register.names.first.name_order.nil?
if @register.names.any? { |n| n.name_order.nil? }
@register.update_name_order
end
@names = @register.names.order(:name_order, created_at: :desc)
@count = @names.count
@names &&= @names.where(rank: params[:rank]) if params[:rank].present?
Expand Down

0 comments on commit 1efbb65

Please sign in to comment.