Skip to content

Commit

Permalink
Run rubocop autocorrect and make fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-s-ccs committed Jan 13, 2025
1 parent 8098b8e commit fe2daf4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def self.add_rates_to_work_packages(work_packages, rates)
end
end

# rubocop:disable Metrics/AbcSize
def self.work_package_to_services(services, work_packages)
full_services = []

Expand All @@ -20,10 +19,9 @@ def self.work_package_to_services(services, work_packages)
service['standard_b'] = standards.include? 'B'
service['standard_c'] = standards.include? 'C'

service['value_type'] = service['code'] == 'M' || service['code'] == 'N' ? 'percentage' : 'money'
service['value_type'] = ['M', 'N'].include?(service['code']) ? 'percentage' : 'money'

full_services.push(service)
end
end
# rubocop:enable Metrics/AbcSize
end
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def service_name(service)
def service_unit(service)
if service['unit_text']
service['unit_text']
elsif service['code'] == 'M.1' || service['code'] == 'N.1'
elsif ['M.1', 'N.1'].include?(service['code'])
'Percentage of Year 1 Deliverables Value (excluding Management and Corporate Overhead, and Profit) at call-off.'
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def services(building, uvals, remove_cafm_help, supplier_id = nil)

copy_params building, uvals

uvals_remove_cafm_help = remove_cafm_help == true ? uvals.reject { |x| x[:service_code] == 'M.1' || x[:service_code] == 'N.1' } : uvals
uvals_remove_cafm_help = remove_cafm_help == true ? uvals.reject { |x| ['M.1', 'N.1'].include?(x[:service_code]) } : uvals

calc_fm = Calculator.new(@contract_length_years,
@tupe_required,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def check_supplier_details_spreadsheet(supplier_details_workbook)
@errors << { error: 'supplier_details_missing_sheets' }
elsif supplier_details_workbook.sheet('RM6232 Suppliers Details').last_row == 1
@errors << { error: 'supplier_details_has_empty_sheets' }
elsif !(supplier_details_workbook.sheet('RM6232 Suppliers Details').row(1) == SUPPLIER_DETAILS_HEADERS || supplier_details_workbook.sheet('RM6232 Suppliers Details').row(1) == SUPPLIER_DETAILS_HEADERS_ACTIVE)
elsif [SUPPLIER_DETAILS_HEADERS, SUPPLIER_DETAILS_HEADERS_ACTIVE].exclude?(supplier_details_workbook.sheet('RM6232 Suppliers Details').row(1))
@errors << { error: 'supplier_details_has_incorrect_headers' }
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def add_prices_sheet(header_row)
end

service_rows.each do |service_row|
if service_row[0] == 'M.1' || service_row[0] == 'N.1'
if ['M.1', 'N.1'].include?(service_row[0])
sheet.add_row [supplier] + service_row + rates_m_and_n
else
sheet.add_row [supplier] + service_row + rates
Expand Down Expand Up @@ -177,7 +177,7 @@ def service_name(service)
def service_unit(service)
if service['unit_text']
service['unit_text']
elsif service['code'] == 'M.1' || service['code'] == 'N.1'
elsif ['M.1', 'N.1'].include?(service['code'])
'Percentage of Year 1 Deliverables Value (excluding Management and Corporate Overhead, and Profit) at call-off.'
end
end
Expand Down

0 comments on commit fe2daf4

Please sign in to comment.