From b24f55cff3d8caf7dac772b8a6c1753206ee2585 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 18 Dec 2023 15:43:49 -0800 Subject: [PATCH] rubocop fix --- .github/workflows/ruby.yml | 4 ++-- app/models/inv_object.rb | 26 +++++++++++++++----------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d909c5540..fddf716e8 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Ruby 3.0 - uses: actions/setup-ruby@v2 + uses: actions/setup-ruby@v1 with: ruby-version: 3.0 @@ -40,7 +40,7 @@ jobs: # Try to retrieve the gems from the cache - name: 'Cache Gems' - uses: actions/cache@v2 + uses: actions/cache@v1 with: path: vendor/bundle key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} diff --git a/app/models/inv_object.rb b/app/models/inv_object.rb index 4c5886690..8c6442fda 100644 --- a/app/models/inv_object.rb +++ b/app/models/inv_object.rb @@ -187,22 +187,26 @@ def object_info_add_localids(json) end end + def object_info_add_version(json, maxfile, ver) + v = { + version_number: ver.number, + created: ver.created, + file_count: ver.inv_files.length, + files: [] + } + ver.inv_files.each do |f| + filecount += 1 + v[:files].push(object_info_files(f)) unless filecount > maxfile + end + json[:versions].prepend(v) + end + def object_info_add_versions(json, maxfile) filecount = 0 inv_versions.each do |ver| retries = 0 begin - v = { - version_number: ver.number, - created: ver.created, - file_count: ver.inv_files.length, - files: [] - } - ver.inv_files.each do |f| - filecount += 1 - v[:files].push(object_info_files(f)) unless filecount > maxfile - end - json[:versions].prepend(v) + object_info_add_version(json, maxfile, ver) # :nocov: rescue StandardError => e retries += 1