Appease the dog overlords
This commit is contained in:
parent
1e86043750
commit
e660b731d7
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Ajax::AnonymousBlockController < AjaxController
|
||||
def create
|
||||
params.require :question
|
||||
|
@ -7,7 +9,7 @@ class Ajax::AnonymousBlockController < AjaxController
|
|||
AnonymousBlock.create!(
|
||||
user: current_user,
|
||||
identifier: AnonymousBlock.get_identifier(question.author_identifier),
|
||||
question: question,
|
||||
question: question
|
||||
)
|
||||
|
||||
question.inboxes.first.destroy
|
||||
|
|
|
@ -40,7 +40,7 @@ class Ajax::QuestionController < AjaxController
|
|||
author_is_anonymous: author_is_anonymous,
|
||||
author_identifier: AnonymousBlock.get_identifier(request.ip),
|
||||
user: current_user,
|
||||
direct: params[:rcpt] != 'followers')
|
||||
direct: params[:rcpt] != "followers")
|
||||
rescue ActiveRecord::RecordInvalid => e
|
||||
Sentry.capture_exception(e)
|
||||
@response[:status] = :rec_inv
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnonymousBlock < ApplicationRecord
|
||||
belongs_to :user
|
||||
belongs_to :question, optional: true
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RenameAuthorEmailToAuthorIdentifier < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
rename_column :questions, :author_email, :author_identifier
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateAnonymousBlocks < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :anonymous_blocks do |t|
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe Ajax::AnonymousBlockController, :ajax_controller, type: :controller do
|
||||
|
|
|
@ -266,7 +266,7 @@ describe Ajax::QuestionController, :ajax_controller, type: :controller do
|
|||
AnonymousBlock.create(
|
||||
user: target_user,
|
||||
identifier: identifier,
|
||||
question: dummy_question,
|
||||
question: dummy_question
|
||||
)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue