Enable soft deletion of Comment::Translations

This commit is contained in:
Senén Rodero Rodríguez
2019-01-23 13:30:32 +01:00
committed by voodoorai2000
parent 16b3ec6e5f
commit 4ce006ec96
3 changed files with 9 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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