-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
32 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
# frozen_string_literal: true | ||
module NotificationHelper | ||
NOTIFICATION_MESSAGES = { | ||
'import_success' => 'Post import succeeded', | ||
'import_fail' => 'Post import failed', | ||
'new_favorite_post' => 'An author you favorited has written a new post', | ||
'joined_favorite_post' => 'An author you favorited has joined a post', | ||
nil => { | ||
'import_success' => 'Post import succeeded', | ||
'import_fail' => 'Post import failed', | ||
'new_favorite_post' => 'A once-favorited subject has a new post', | ||
'joined_favorite_post' => 'A once-favorited author has joined a post', | ||
}, | ||
'user' => { | ||
'new_favorite_post' => 'An author you favorited has written a new post', | ||
'joined_favorite_post' => 'An author you favorited has joined a post', | ||
}, | ||
'board' => { | ||
'new_favorite_post' => 'An continuity you favorited has a new post', | ||
}, | ||
} | ||
|
||
def subject_for_type(notification_type) | ||
NOTIFICATION_MESSAGES[notification_type] | ||
def subject_for_type(notification_type, favorite_type) | ||
NOTIFICATION_MESSAGES[favorite_type][notification_type] | ||
end | ||
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
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
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