diff --git a/db/migrate/20190123122936_add_hidden_at_to_comment_translations.rb b/db/migrate/20190123122936_add_hidden_at_to_comment_translations.rb new file mode 100644 index 000000000..bf66b7386 --- /dev/null +++ b/db/migrate/20190123122936_add_hidden_at_to_comment_translations.rb @@ -0,0 +1,6 @@ +class AddHiddenAtToCommentTranslations < ActiveRecord::Migration[4.2] + def change + add_column :comment_translations, :hidden_at, :datetime + add_index :comment_translations, :hidden_at + end +end diff --git a/db/schema.rb b/db/schema.rb index 30abee152..925e935f3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -421,7 +421,9 @@ ActiveRecord::Schema.define(version: 20190607160900) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.text "body" + t.datetime "hidden_at" t.index ["comment_id"], name: "index_comment_translations_on_comment_id", using: :btree + t.index ["hidden_at"], name: "index_comment_translations_on_hidden_at", using: :btree t.index ["locale"], name: "index_comment_translations_on_locale", using: :btree end diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index fac612404..d4f368c0b 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -6,6 +6,7 @@ describe Comment do it_behaves_like "has_public_author" it_behaves_like "globalizable", :comment + it_behaves_like "acts as paranoid", :comment it "is valid" do expect(comment).to be_valid