Project

General

Profile

Refactor #18719

Replace deprecated Fixnum constants

Added by Dominic Cleal over 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

There are references in Foreman's codebase to the constant Fixnum, which is deprecated in Ruby 2.4. It is likely that replacing these with Integer is sufficient, as Fixnum is derived from Integer.

app/services/authorizer.rb
184:    @base_ids ||= @base_collection.all? { |i| i.is_a?(Fixnum) } ? @base_collection : @base_collection.map(&:id)

app/controllers/api/v2/interfaces_controller.rb
41:        param :subnet_id, Fixnum, :desc => N_("Foreman subnet ID of IPv4 interface")
42:        param :subnet6_id, Fixnum, :desc => N_("Foreman subnet ID of IPv6 interface")
43:        param :domain_id, Fixnum, :desc => N_("Foreman domain ID of interface. Required for primary interfaces on managed hosts.")

app/controllers/api/v2/external_usergroups_controller.rb
30:          param :auth_source_id, Fixnum, :required => true, :desc => N_('ID of linked authentication source')

app/models/config_report.rb
39:          when Integer, Fixnum

lib/foreman/cast.rb
11:      when Fixnum

Associated revisions

Revision e8d612bd (diff)
Added by Dominic Cleal over 5 years ago

fixes #18719 - replace usage of deprecated Fixnum constant

Most type checks for Fixnum can safely be replaced by Integer, as prior
to Ruby 2.4, Fixnum was a subclass of Integer and so the conditional
holds.

History

#1 Updated by The Foreman Bot over 5 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Dominic Cleal
  • Pull request https://github.com/theforeman/foreman/pull/4405 added

#2 Updated by Dominic Cleal over 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Ohad Levy about 5 years ago

  • Legacy Backlogs Release (now unused) set to 209

Also available in: Atom PDF