You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
606 B

  1. # frozen_string_literal: true
  2. class BootstrapTimelineService < BaseService
  3. def call(source_account)
  4. @source_account = source_account
  5. autofollow_inviter!
  6. notify_staff!
  7. end
  8. private
  9. def autofollow_inviter!
  10. return unless @source_account&.user&.invite&.autofollow?
  11. FollowService.new.call(@source_account, @source_account.user.invite.user.account)
  12. end
  13. def notify_staff!
  14. User.those_who_can(:manage_users).includes(:account).find_each do |user|
  15. LocalNotificationWorker.perform_async(user.account_id, @source_account.id, 'Account', 'admin.sign_up')
  16. end
  17. end
  18. end