Skip to content
3 changes: 1 addition & 2 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def create
@user.build_discord_profile
@user.credit_card_payment = params[:credit_card_payment]
@user.uploaded_avatar = user_params[:avatar]

ActiveSupport::Notifications.instrument('user.create', user: @user)
@user.unsubscribe_email_token = SecureRandom.urlsafe_base64
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この処理は無くなっても大丈夫でしょうか?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@komagata

お疲れ様です。ご確認ありがとうございます。

こちらの処理でSignUpNotifierを呼び出しているのですが、行っている処理はメール配信停止用のトークンを発行して、ユーザーに設定を行うことです。

@tyrrell-IH さんともやり取りをしたのですが、クラス名と異なり通知機能を備えていない(通知は別の箇所で行っています)ため、メール配信停止トークンの設定は別途切り出し、
( @user.unsubscribe_email_token = SecureRandom.urlsafe_base64の箇所です)該当箇所を削除しました。

以上よろしくお願いいたします。


if @user.staff? || @user.trainee?
create_free_user!
Expand Down
8 changes: 0 additions & 8 deletions app/models/sign_up_notifier.rb

This file was deleted.

5 changes: 2 additions & 3 deletions config/initializers/active_support_notifications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
ActiveSupport::Notifications.subscribe('product.create', ProductNotifierForColleague.new)
ActiveSupport::Notifications.subscribe('product.create', ProductNotifierForPracticeWatcher.new)
ActiveSupport::Notifications.subscribe('came.inquiry', InquiryNotifier.new)
ActiveSupport::Notifications.subscribe('regular_event.update', RegularEventUpdateNotifier.new)
ActiveSupport::Notifications.subscribe('student_or_trainee.create', TimesChannelCreator.new)

learning_status_updater = LearningStatusUpdater.new
ActiveSupport::Notifications.subscribe('product.save', learning_status_updater)
Expand All @@ -38,7 +40,4 @@
learning_cache_destroyer = LearningCacheDestroyer.new
ActiveSupport::Notifications.subscribe('learning.create', learning_cache_destroyer)
ActiveSupport::Notifications.subscribe('learning.destroy', learning_cache_destroyer)
ActiveSupport::Notifications.subscribe('student_or_trainee.create', TimesChannelCreator.new)
ActiveSupport::Notifications.subscribe('user.create', SignUpNotifier.new)
ActiveSupport::Notifications.subscribe('regular_event.update', RegularEventUpdateNotifier.new)
end