Skip to content

Commit

Permalink
fixed linter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
agravell047 committed Apr 24, 2024
1 parent 94f7a7d commit 0797f10
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def sort_by(resource, sort_params)
end
sort_params.each_with_index do |field, index|
field_camelcase = field.sub(/^-/, '').gsub(/_([a-z])/) { ::Regexp.last_match(1).upcase }
(resource.metadata[:sort] ||= {}).merge!({ field_camelcase => sort_orders[index] ? 'DESC' : 'ASC' }) if field.present?
if field.present?
(resource.metadata[:sort] ||= {}).merge!({ field_camelcase => sort_orders[index] ? 'DESC' : 'ASC' })
end
end
resource
end
Expand Down

0 comments on commit 0797f10

Please sign in to comment.