diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2012-09-25 08:55:35 +1000 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2012-09-25 08:55:35 +1000 |
commit | f59700138f7360436767fddea554c739e2cd484b (patch) | |
tree | 8c3af52f3f1f369ab412fa7571f19860e4f260b8 /app/helpers | |
parent | 265e336ae0608af39aa3aad8b27862e572222562 (diff) |
Extract configuration with defaults into one module
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/config_helper.rb | 4 | ||||
-rwxr-xr-x | app/helpers/link_to_helper.rb | 4 | ||||
-rw-r--r-- | app/helpers/mailer_helper.rb | 4 |
3 files changed, 5 insertions, 7 deletions
diff --git a/app/helpers/config_helper.rb b/app/helpers/config_helper.rb index 543b60256..0f18c0c4b 100644 --- a/app/helpers/config_helper.rb +++ b/app/helpers/config_helper.rb @@ -1,9 +1,9 @@ module ConfigHelper def site_name - MySociety::Config.get('SITE_NAME', 'Alaveteli') + Configuration::site_name end def force_registration_on_new_request - MySociety::Config.get('FORCE_REGISTRATION_ON_NEW_REQUEST', false) + Configuration::force_registration_on_new_request end end
\ No newline at end of file diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index cae17ebd3..c8ad7bc30 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -221,7 +221,7 @@ module LinkToHelper # Admin pages def admin_url(relative_path) - admin_url_prefix = MySociety::Config.get("ADMIN_BASE_URL", "") + admin_url_prefix = Configuration::admin_base_url admin_url_prefix = admin_general_index_path+"/" if admin_url_prefix.empty? return admin_url_prefix + relative_path end @@ -241,7 +241,7 @@ module LinkToHelper def main_url(relative_path, append = nil) - url_prefix = "http://" + MySociety::Config.get("DOMAIN", '127.0.0.1:3000') + url_prefix = "http://" + Configuration::domain url = url_prefix + relative_path if !append.nil? begin diff --git a/app/helpers/mailer_helper.rb b/app/helpers/mailer_helper.rb index c0a950d47..be2ce47aa 100644 --- a/app/helpers/mailer_helper.rb +++ b/app/helpers/mailer_helper.rb @@ -1,7 +1,5 @@ module MailerHelper def contact_from_name_and_email - contact_name = MySociety::Config.get("CONTACT_NAME", 'Alaveteli') - contact_email = MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost') - return "#{contact_name} <#{contact_email}>" + "#{Configuration::contact_name} <#{Configuration::contact_email}>" end end |