Refactor #16221

private method `zones_map' called for ActiveSupport::TimeZone:Class

Added by Dominic Cleal 7 months ago. Updated 7 months ago.

Status:Closed
Priority:Normal
Assigned To:Dominic Cleal
Category:API
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/3759
Story points-
Velocity based estimate-
Release1.13.0Release relationshipAuto

Description

The documentation in the users API controller lists possible values for timezones by calling ActiveSupport::TimeZone.zones_map, however this method is private in Rails 5.0:

MethodError: private method `zones_map' called for ActiveSupport::TimeZone:Class
/home/dcleal/code/foreman/foreman/app/controllers/api/v2/users_controller.rb:50:in `block (2 levels) in <class:UsersController>'

It should be replaced by a method that remains public.

Note the same list is obtained by the time_zone_select form helper, which lists timezones through .all.

Associated revisions

Revision abebb994
Added by Dominic Cleal 7 months ago

fixes #16221 - replace private AS timezone listing method

History

#1 Updated by The Foreman Bot 7 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3759 added

#2 Updated by Dominic Cleal 7 months ago

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

#3 Updated by Dominic Cleal 7 months ago

  • Release set to 1.13.0

Also available in: Atom PDF