[Rails5] Fix `can't modify frozen Array` errors
What does this MR do?
Fixes
RuntimeError:
can't modify frozen Array
errors for rails5 specs.
Example:
300) cycle analytics events GET /:namespace/:project/cycle_analytics/events/issues lists the issue events
Failure/Error: users.compact!
RuntimeError:
can't modify frozen Array
# ./app/services/notification_recipient_service.rb:58:in `compact!'
# ./app/services/notification_recipient_service.rb:58:in `add_recipients'
# ./app/services/notification_recipient_service.rb:124:in `add_project_watchers'
# ./app/services/notification_recipient_service.rb:217:in `build!'
# ./app/services/notification_recipient_service.rb:80:in `notification_recipients'
# ./app/services/notification_recipient_service.rb:14:in `build_recipients'
# ./app/services/notification_service.rb:379:in `new_resource_email'
# ./app/services/notification_service.rb:113:in `new_merge_request'
# ./app/workers/new_merge_request_worker.rb:9:in `perform'
# Skipped...
Are there points in the code the reviewer needs to double check?
No.
Why was this MR needed?
Migration to Rails 5.0.
Screenshots (if relevant)
No.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Edited by blackst0ne