Add writing role for some moderation classes, update verification method.
This commit is contained in:
parent
5a5150757e
commit
7a2594e105
|
@ -1,4 +1,5 @@
|
|||
class Settings::Verifications::ModerationController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@verification_requests = AccountVerificationRequest.order('created_at DESC').all
|
||||
end
|
||||
|
@ -10,11 +11,12 @@ class Settings::Verifications::ModerationController < Admin::BaseController
|
|||
|
||||
# Mark user as verified
|
||||
account = verification_request.account
|
||||
account.is_verified = true
|
||||
account.save()
|
||||
ApplicationRecord.transaction do
|
||||
account.update!(is_verified: true)
|
||||
|
||||
# Remove all traces
|
||||
verification_request.destroy()
|
||||
# Remove all traces
|
||||
verification_request.destroy
|
||||
end
|
||||
end
|
||||
|
||||
# Notify user
|
||||
|
|
|
@ -15,6 +15,11 @@ class AccountModerationNote < ApplicationRecord
|
|||
belongs_to :account
|
||||
belongs_to :target_account, class_name: 'Account'
|
||||
|
||||
connects_to database: {
|
||||
writing: :master,
|
||||
reading: :master
|
||||
}
|
||||
|
||||
scope :latest, -> { reorder('created_at DESC') }
|
||||
|
||||
validates :content, presence: true, length: { maximum: 500 }
|
||||
|
|
|
@ -13,6 +13,12 @@
|
|||
#
|
||||
|
||||
class AccountVerificationRequest < ApplicationRecord
|
||||
|
||||
connects_to database: {
|
||||
writing: :master,
|
||||
reading: :master
|
||||
}
|
||||
|
||||
LIMIT = 4.megabytes
|
||||
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
|
||||
|
||||
|
|
|
@ -29,6 +29,11 @@ class Report < ApplicationRecord
|
|||
|
||||
validates :comment, length: { maximum: 1000 }
|
||||
|
||||
connects_to database: {
|
||||
writing: :master,
|
||||
reading: :master
|
||||
}
|
||||
|
||||
def local?
|
||||
false # Force uri_for to use uri attribute
|
||||
end
|
||||
|
|
|
@ -18,4 +18,10 @@ class ReportNote < ApplicationRecord
|
|||
scope :latest, -> { reorder(created_at: :desc) }
|
||||
|
||||
validates :content, presence: true, length: { maximum: 500 }
|
||||
|
||||
connects_to database: {
|
||||
writing: :master,
|
||||
reading: :master
|
||||
}
|
||||
|
||||
end
|
||||
|
|
|
@ -23,6 +23,11 @@ class SessionActivation < ApplicationRecord
|
|||
to: :access_token,
|
||||
allow_nil: true
|
||||
|
||||
connects_to database: {
|
||||
writing: :master,
|
||||
reading: :master
|
||||
}
|
||||
|
||||
def detection
|
||||
@detection ||= Browser.new(user_agent)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue