Files
danbooru/app/logical/forum_updater.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

17 lines
364 B
Ruby

# frozen_string_literal: true
# Add a post to a forum topic.
class ForumUpdater
attr_reader :forum_topic
def initialize(forum_topic)
@forum_topic = forum_topic
end
def update(message)
CurrentUser.scoped(User.system) do
forum_topic.forum_posts.create(body: message, skip_mention_notifications: true, creator: User.system)
end
end
end