.sort in Rails 5 returns an array, but scopes like in_default_view is called on the sorted array. This changes the rake task to use SQL sorting with order instead.
Related issues
Bug #23943: foreman-rake katello:regenerate_repo_metadata failed with "NoMethodError: undefined method `in_default_view' for #<Array:0x000000000ce126f0>"
fixes #23943 - use order instead of sort
.sort in Rails 5 returns an array, but scopes like in_default_view is
called on the sorted array. This changes the rake task to use SQL
sorting with order instead.