-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathnewspaper.rb
67 lines (49 loc) · 2.8 KB
/
newspaper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# frozen_string_literal: true
Rails.configuration.to_prepare do
Newspaper.subscribe(:event_create, EventOrganizerWatcher.new)
Newspaper.subscribe(:answer_create, AnswerNotifier.new)
Newspaper.subscribe(:answer_create, NotifierToWatchingUser.new)
Newspaper.subscribe(:announcement_destroy, AnnouncementNotificationDestroyer.new)
Newspaper.subscribe(:answer_create, AnswererWatcher.new)
announcement_notifier = AnnouncementNotifier.new
Newspaper.subscribe(:announcement_create, announcement_notifier)
Newspaper.subscribe(:announcement_update, announcement_notifier)
sad_streak_updater = SadStreakUpdater.new
Newspaper.subscribe(:report_save, sad_streak_updater)
Newspaper.subscribe(:report_destroy, sad_streak_updater)
Newspaper.subscribe(:report_save, FirstReportNotifier.new)
Newspaper.subscribe(:report_save, ReportNotifier.new)
learning_cache_destroyer = LearningCacheDestroyer.new
Newspaper.subscribe(:learning_create, learning_cache_destroyer)
Newspaper.subscribe(:learning_destroy, learning_cache_destroyer)
answer_cache_destroyer = AnswerCacheDestroyer.new
Newspaper.subscribe(:answer_save, answer_cache_destroyer)
Newspaper.subscribe(:answer_destroy, answer_cache_destroyer)
Newspaper.subscribe(:correct_answer_save, CorrectAnswerNotifier.new)
Newspaper.subscribe(:user_create, SignUpNotifier.new)
Newspaper.subscribe(:student_or_trainee_create, TimesChannelCreator.new)
Newspaper.subscribe(:regular_event_update, RegularEventUpdateNotifier.new)
Newspaper.subscribe(:graduation_update, GraduationNotifier.new)
Newspaper.subscribe(:comeback_update, ComebackNotifier.new)
Newspaper.subscribe(:product_create, ProductAuthorWatcher.new)
learning_status_updater = LearningStatusUpdater.new
Newspaper.subscribe(:check_create, learning_status_updater)
Newspaper.subscribe(:product_create, learning_status_updater)
Newspaper.subscribe(:product_update, learning_status_updater)
page_notifier = PageNotifier.new
Newspaper.subscribe(:page_create, page_notifier)
Newspaper.subscribe(:page_update, page_notifier)
product_notifier = ProductNotifier.new
Newspaper.subscribe(:product_create, product_notifier)
Newspaper.subscribe(:product_update, product_notifier)
mentors_watch_for_question_creator = MentorsWatchForQuestionCreator.new
Newspaper.subscribe(:question_create, mentors_watch_for_question_creator)
Newspaper.subscribe(:question_update, mentors_watch_for_question_creator)
ai_answer_creator = AIAnswerCreator.new
Newspaper.subscribe(:question_create, ai_answer_creator)
Newspaper.subscribe(:question_update, ai_answer_creator)
Newspaper.subscribe(:retirement_create, UnfinishedDataDestroyer.new)
question_notifier = QuestionNotifier.new
Newspaper.subscribe(:question_create, question_notifier)
Newspaper.subscribe(:question_update, question_notifier)
end