* feat: add a new script that updates the email_addresses hash with the contact key * add a comment to old data script * feat: add a spec (not passing as yet) * fix: test passing * chore: comment script with reason
17 lines
655 B
Ruby
17 lines
655 B
Ruby
module DataUpdateScripts
|
|
class UpdateDefaultEmailAddresses
|
|
def run
|
|
return if SiteConfig.email_addresses[:contact].present?
|
|
|
|
# In order to trigger the attribute setter on the SiteConfig hash object,
|
|
# it seems like we need to set all the values in the hash and not only the one we are changing.
|
|
SiteConfig.email_addresses = {
|
|
default: SiteConfig.email_addresses[:default],
|
|
business: SiteConfig.email_addresses[:business],
|
|
privacy: SiteConfig.email_addresses[:privacy],
|
|
members: SiteConfig.email_addresses[:members],
|
|
contact: ApplicationConfig["DEFAULT_EMAIL"]
|
|
}
|
|
end
|
|
end
|
|
end
|