diff --git a/db/migrate/20190123122752_add_hidden_at_to_debate_translations.rb b/db/migrate/20190123122752_add_hidden_at_to_debate_translations.rb new file mode 100644 index 000000000..6995ad6f2 --- /dev/null +++ b/db/migrate/20190123122752_add_hidden_at_to_debate_translations.rb @@ -0,0 +1,6 @@ +class AddHiddenAtToDebateTranslations < ActiveRecord::Migration[4.2] + def change + add_column :debate_translations, :hidden_at, :datetime + add_index :debate_translations, :hidden_at + end +end diff --git a/db/schema.rb b/db/schema.rb index 3e01bc8fa..90b287745 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -495,7 +495,9 @@ ActiveRecord::Schema.define(version: 20190607160900) do t.datetime "updated_at", null: false t.string "title" t.text "description" + t.datetime "hidden_at" t.index ["debate_id"], name: "index_debate_translations_on_debate_id", using: :btree + t.index ["hidden_at"], name: "index_debate_translations_on_hidden_at", using: :btree t.index ["locale"], name: "index_debate_translations_on_locale", using: :btree end diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index 7d6e22763..2b6416284 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -10,6 +10,7 @@ describe Debate do it_behaves_like "has_public_author" it_behaves_like "notifiable" it_behaves_like "sanitizable" + it_behaves_like "acts as paranoid", :debate end it "is valid" do