-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #12: avoid the execution of notifier on rake tasks
- Loading branch information
1 parent
b508dff
commit a548781
Showing
2 changed files
with
10 additions
and
4 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 |
---|---|---|
|
@@ -9,7 +9,7 @@ class Notifier | |
def initialize | ||
@notifications = [] | ||
@options = {} | ||
|
||
return if $rails_rake_task | ||
if Rails.env.development? or Rails.env.test? | ||
@options = {:to => '[email protected]'} | ||
first_at = Time.now + 1.second | ||
|
@@ -50,6 +50,7 @@ def send_emails | |
end | ||
end | ||
|
||
#ToDo: Use rails logger | ||
def display_notification_info(notification) | ||
puts "\n#{Time.now.strftime('%Y/%m/%d %H:%M:%S')}" | ||
puts "########## Notification ##########" | ||
|
@@ -59,4 +60,3 @@ def display_notification_info(notification) | |
puts "##################################" | ||
end | ||
end | ||
|