roadmap
roadmap copied to clipboard
Update Handling of `contact_us_url` in `def app_email`
Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
-
4.1.1
Description
- The value for
contact_us_urlis set via thecontact_usgem. If we want to define a custom value for this, the codebase also allows us to do so viaRails.application.config.x.organisation.contact_us_url. - Throughout the codebase, there are many statements similar to the following:
contact_us = Rails.configuration.x.organisation.contact_us_url || contact_us_url - However, there is one exception to this in
app/services/extermal_apis/base_service.rb:
def app_email
dflt = Rails.application.routes.url_helpers.contact_us_url || ''
Rails.configuration.x.organisation.fetch(:helpdesk_email, dflt)
end
- The problem here is that, like
contact_us_url, the value forRails.application.routes.url_helpers.contact_us_urlis is set via thecontact_usgem. If we again want allow for a custom defined valued, then maybe we should change the code to the following:
def app_email
dflt = Rails.configuration.x.organisation.contact_us_url || contact_us_url
Rails.configuration.x.organisation.fetch(:helpdesk_email, dflt)
end