docs: add remaining docs for classes in app/logical.

This commit is contained in:
evazion
2021-06-23 20:32:59 -05:00
parent c6855261fe
commit 00ca7526bb
47 changed files with 705 additions and 25 deletions

View File

@@ -1,6 +1,16 @@
# Promotes the user to a higher level, or grants them approver or unlimited
# uploader privileges. Also validates that the promotion is allowed, gives the
# user a feedback, sends them a notification dmail, and creates a mod action for
# the promotion.
class UserPromotion
attr_reader :user, :promoter, :new_level, :old_can_approve_posts, :old_can_upload_free, :can_upload_free, :can_approve_posts
# Initialize a new promotion.
# @param user [User] the user to promote
# @param promoter [User] the user doing the promotion
# @param new_level [Integer] the new user level
# @param can_upload_free [Boolean] whether the user should gain unlimited upload privileges
# @param can_approve_posts [Boolean] whether the user should gain approval privileges
def initialize(user, promoter, new_level, can_upload_free: nil, can_approve_posts: nil)
@user = user
@promoter = promoter
@@ -54,6 +64,7 @@ class UserPromotion
end
end
# Build the dmail and user feedback message.
def build_messages
messages = []