docbrown/app/observers/application_observer.rb
2019-06-18 14:47:53 -04:00

10 lines
502 B
Ruby

class ApplicationObserver < ActiveRecord::Observer
def warned_user_ping(activity)
return unless activity.user.warned == true
SlackBotPingJob.perform_later message: "Activity: https://dev.to/#{activity.path}\nManage @#{activity.user.username}: https://dev.to/internal/users/#{activity.user.id}",
channel: "warned-user-comments",
username: "sloan_watch_bot",
icon_emoji: ":sloan:"
end
end