Appease the dog overlords

This commit is contained in:
Karina Kwiatek 2022-07-06 19:46:30 +02:00 committed by Karina Kwiatek
parent 9bcf1a80ad
commit 1ec99dd767
3 changed files with 7 additions and 5 deletions

View File

@ -6,10 +6,10 @@ class Ajax::InboxController < AjaxController
return return
end end
question = Question.create!(content: QuestionGenerator.generate, question = Question.create!(content: QuestionGenerator.generate,
author_is_anonymous: true, author_is_anonymous: true,
author_identifier: 'justask', author_identifier: "justask",
user: current_user) user: current_user)
inbox = Inbox.create!(user: current_user, question_id: question.id, new: true) inbox = Inbox.create!(user: current_user, question_id: question.id, new: true)

View File

@ -10,7 +10,7 @@ class ExportWorker
exporter.export exporter.export
question = Question.create(content: "Your #{APP_CONFIG['site_name']} data export is ready! You can download it " + question = Question.create(content: "Your #{APP_CONFIG['site_name']} data export is ready! You can download it " +
"from the settings page under the \"Export\" tab.", author_is_anonymous: true, "from the settings page under the \"Export\" tab.", author_is_anonymous: true,
author_identifier: "retrospring_exporter") author_identifier: "retrospring_exporter")
Inbox.create(user_id: user_id, question_id: question.id, new: true) Inbox.create(user_id: user_id, question_id: question.id, new: true)
end end
end end

View File

@ -1,5 +1,7 @@
# frozen_string_literal: true
class DropAuthorNameFieldFromQuestions < ActiveRecord::Migration[6.1] class DropAuthorNameFieldFromQuestions < ActiveRecord::Migration[6.1]
def change def up
execute "update questions set author_identifier = author_name where author_name is not null and author_identifier is null;" execute "update questions set author_identifier = author_name where author_name is not null and author_identifier is null;"
remove_column :questions, :author_name remove_column :questions, :author_name
end end