File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def models_file
2626 File . expand_path ( 'models.json' , __dir__ )
2727 end
2828
29- def refresh! # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
29+ def refresh! # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
3030 configured = Provider . configured_providers
3131
3232 # Log provider status
@@ -38,7 +38,8 @@ def refresh! # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
3838 current = instance . load_models
3939 preserved = current . reject { |m | configured . map ( &:slug ) . include? ( m . provider ) }
4040
41- @instance = new ( preserved + configured . flat_map ( &:list_models ) )
41+ all = ( preserved + configured . flat_map ( &:list_models ) ) . sort_by ( &:id )
42+ @instance = new ( all )
4243 @instance . save_models
4344 @instance
4445 end
You can’t perform that action at this time.
0 commit comments