Skip to content

Commit

Permalink
PgSQL issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Nov 26, 2024
1 parent 11cc5d0 commit 6d76665
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/registers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def index(status = :validated)
# GET /registers/r:abcd.json
def show
@register.update_name_order if @register.names.first.name_order.nil?
@names = @register.names
@names = @register.names.order(:name_order, created_at: :desc)
@count = @names.count
@names &&= @names.where(rank: params[:rank]) if params[:rank].present?
@names &&= @names.paginate(page: params[:page], per_page: 30)
Expand Down
3 changes: 2 additions & 1 deletion app/models/register.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class Register < ApplicationRecord
has_one_attached(:publication_pdf)
has_one_attached(:supplementary_pdf)
has_one_attached(:certificate_pdf)
has_many(:names, -> { order(:name_order, created_at: :desc) })
#has_many(:names, -> { order(:name_order, created_at: :desc) })
has_many(:names)
has_many(
:register_correspondences, -> { order(:created_at) }, dependent: :destroy
)
Expand Down

0 comments on commit 6d76665

Please sign in to comment.