This repository has been archived by the owner on Jul 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1597 from YaleSTC/1584_use_app_config_check
[1584] Use AppConfig#check
- Loading branch information
Showing
7 changed files
with
12 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ class UserMailer < ActionMailer::Base | |
# Workaround so that RSpec start-up doesn't fail. | ||
# TODO: Have RSpec initialize AppConfig with configuration. | ||
add_template_helper(ApplicationHelper) | ||
if AppConfig.first.nil? | ||
default from: '[email protected]' | ||
else | ||
if AppConfig.check :admin_email | ||
default from: AppConfig.get(:admin_email), cc: AppConfig.get(:admin_email) | ||
else | ||
default from: '[email protected]' | ||
end | ||
|
||
# checks the status of the current reservation and sends the appropriate email | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,9 @@ | |
# Configure the e-mail address which will be shown in Devise::Mailer, | ||
# note that it will be overwritten if you use your own mailer class | ||
# with default "from" parameter. | ||
config.mailer_sender = if AppConfig.table_exists? && !AppConfig.first.nil? | ||
AppConfig.first.admin_email | ||
config.mailer_sender = if AppConfig.table_exists? && | ||
AppConfig.check(:admin_email) | ||
AppConfig.get :admin_email | ||
else | ||
'[email protected]' | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters