From 1ec99dd76782c5ffeabfc16da4adec5ba71cb0bd Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Wed, 6 Jul 2022 19:46:30 +0200 Subject: [PATCH] Appease the dog overlords --- app/controllers/ajax/inbox_controller.rb | 6 +++--- app/workers/export_worker.rb | 2 +- .../20220706174120_drop_author_name_field_from_questions.rb | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/controllers/ajax/inbox_controller.rb b/app/controllers/ajax/inbox_controller.rb index 4c6b33a3..6d83d189 100644 --- a/app/controllers/ajax/inbox_controller.rb +++ b/app/controllers/ajax/inbox_controller.rb @@ -6,10 +6,10 @@ class Ajax::InboxController < AjaxController return end - question = Question.create!(content: QuestionGenerator.generate, + question = Question.create!(content: QuestionGenerator.generate, author_is_anonymous: true, - author_identifier: 'justask', - user: current_user) + author_identifier: "justask", + user: current_user) inbox = Inbox.create!(user: current_user, question_id: question.id, new: true) diff --git a/app/workers/export_worker.rb b/app/workers/export_worker.rb index 368f5ea6..420ee06e 100644 --- a/app/workers/export_worker.rb +++ b/app/workers/export_worker.rb @@ -10,7 +10,7 @@ class ExportWorker exporter.export 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, - author_identifier: "retrospring_exporter") + author_identifier: "retrospring_exporter") Inbox.create(user_id: user_id, question_id: question.id, new: true) end end diff --git a/db/migrate/20220706174120_drop_author_name_field_from_questions.rb b/db/migrate/20220706174120_drop_author_name_field_from_questions.rb index b7cdd9ec..b33da8a5 100644 --- a/db/migrate/20220706174120_drop_author_name_field_from_questions.rb +++ b/db/migrate/20220706174120_drop_author_name_field_from_questions.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + 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;" remove_column :questions, :author_name end