From e451c4657cb2a8e6c551bd7c0b8dc12976df9e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 21 Jan 2019 13:31:20 +0100 Subject: [PATCH] Enable soft_deletion of Poll::Translations --- .../20190121122946_add_hidden_at_to_poll_translations.rb | 6 ++++++ db/schema.rb | 2 ++ spec/models/poll/poll_spec.rb | 1 + 3 files changed, 9 insertions(+) create mode 100644 db/migrate/20190121122946_add_hidden_at_to_poll_translations.rb diff --git a/db/migrate/20190121122946_add_hidden_at_to_poll_translations.rb b/db/migrate/20190121122946_add_hidden_at_to_poll_translations.rb new file mode 100644 index 000000000..efa49d872 --- /dev/null +++ b/db/migrate/20190121122946_add_hidden_at_to_poll_translations.rb @@ -0,0 +1,6 @@ +class AddHiddenAtToPollTranslations < ActiveRecord::Migration[4.2] + def change + add_column :poll_translations, :hidden_at, :datetime + add_index :poll_translations, :hidden_at + end +end diff --git a/db/schema.rb b/db/schema.rb index ff20fd9de..e882755bc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1223,6 +1223,8 @@ ActiveRecord::Schema.define(version: 20190607160900) do t.string "name" t.text "summary" t.text "description" + t.datetime "hidden_at" + t.index ["hidden_at"], name: "index_poll_translations_on_hidden_at", using: :btree t.index ["locale"], name: "index_poll_translations_on_locale", using: :btree t.index ["poll_id"], name: "index_poll_translations_on_poll_id", using: :btree end diff --git a/spec/models/poll/poll_spec.rb b/spec/models/poll/poll_spec.rb index e03d941b1..3cfe2f335 100644 --- a/spec/models/poll/poll_spec.rb +++ b/spec/models/poll/poll_spec.rb @@ -6,6 +6,7 @@ describe Poll do describe "Concerns" do it_behaves_like "notifiable" + it_behaves_like "acts as paranoid", :poll it_behaves_like "reportable" end