diff options
author | Rémy Coutable <remy@rymai.me> | 2018-02-27 19:04:34 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-02-27 19:34:16 +0300 |
commit | ea32e1c41f2a1e2d5b68e2732d50caaec5bbb954 (patch) | |
tree | 7533136e47b33febb9e72f8f48de4a8bcca16ac9 /lib | |
parent | 7d12f3a84e39c6be6f3798e37b39f0023ece71ec (diff) |
Fix a "can't modify frozen Hash" error in lib/api/services.rb in development env
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/services.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/api/services.rb b/lib/api/services.rb index c5fb5db724f..6c97659166d 100644 --- a/lib/api/services.rb +++ b/lib/api/services.rb @@ -139,7 +139,7 @@ module API } ].freeze - SERVICES = { + services = { 'asana' => [ { required: true, @@ -673,9 +673,9 @@ module API desc: 'The password of the user' } ] - }.freeze + } - SERVICE_CLASSES = [ + service_classes = [ AsanaService, AssemblaService, BambooService, @@ -704,10 +704,10 @@ module API MattermostService, MicrosoftTeamsService, TeamcityService - ].freeze + ] if Rails.env.development? - SERVICES['mock-ci'] = [ + services['mock-ci'] = [ { required: true, name: :mock_service_url, @@ -715,16 +715,19 @@ module API desc: 'URL to the mock service' } ] - SERVICES['mock-deployment'] = [] - SERVICES['mock-monitoring'] = [] + services['mock-deployment'] = [] + services['mock-monitoring'] = [] - SERVICE_CLASSES += [ + service_classes += [ MockCiService, MockDeploymentService, MockMonitoringService ] end + SERVICES = services.freeze + SERVICE_CLASSES = service_classes.freeze + SERVICE_CLASSES.each do |service| event_names = service.try(:event_names) || next event_names.each do |event_name| |