Enable soft_deletion of Legislation::DraftVersion::Translations

This commit is contained in:
Senén Rodero Rodríguez
2019-01-21 13:17:15 +01:00
committed by voodoorai2000
parent 458fb750eb
commit f6b41f916b
3 changed files with 12 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
class AddHiddenAtToLegislationDraftVersionTranslations < ActiveRecord::Migration[4.2]
def change
add_column :legislation_draft_version_translations, :hidden_at, :datetime
add_index :legislation_draft_version_translations, :hidden_at
end
end

View File

@@ -716,6 +716,8 @@ ActiveRecord::Schema.define(version: 20190607160900) do
t.text "body" t.text "body"
t.text "body_html" t.text "body_html"
t.text "toc_html" t.text "toc_html"
t.datetime "hidden_at"
t.index ["hidden_at"], name: "index_legislation_draft_version_translations_on_hidden_at", using: :btree
t.index ["legislation_draft_version_id"], name: "index_900e5ba94457606e69e89193db426e8ddff809bc", using: :btree t.index ["legislation_draft_version_id"], name: "index_900e5ba94457606e69e89193db426e8ddff809bc", using: :btree
t.index ["locale"], name: "index_legislation_draft_version_translations_on_locale", using: :btree t.index ["locale"], name: "index_legislation_draft_version_translations_on_locale", using: :btree
end end

View File

@@ -1,8 +1,10 @@
require "rails_helper" require "rails_helper"
RSpec.describe Legislation::DraftVersion, type: :model do describe Legislation::DraftVersion do
let(:legislation_draft_version) { build(:legislation_draft_version) } let(:legislation_draft_version) { build(:legislation_draft_version) }
it_behaves_like "acts as paranoid", :legislation_draft_version
it "is valid" do it "is valid" do
expect(legislation_draft_version).to be_valid expect(legislation_draft_version).to be_valid
end end