diff --git a/db/migrate/20190121121420_add_hidden_at_to_legislation_draft_version_translations.rb b/db/migrate/20190121121420_add_hidden_at_to_legislation_draft_version_translations.rb new file mode 100644 index 000000000..b83dc1adc --- /dev/null +++ b/db/migrate/20190121121420_add_hidden_at_to_legislation_draft_version_translations.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 313147f38..6bc039cdc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -716,6 +716,8 @@ ActiveRecord::Schema.define(version: 20190607160900) do t.text "body" t.text "body_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 ["locale"], name: "index_legislation_draft_version_translations_on_locale", using: :btree end diff --git a/spec/models/legislation/draft_version_spec.rb b/spec/models/legislation/draft_version_spec.rb index 42d9e6401..0b8ceb451 100644 --- a/spec/models/legislation/draft_version_spec.rb +++ b/spec/models/legislation/draft_version_spec.rb @@ -1,7 +1,9 @@ require "rails_helper" -RSpec.describe Legislation::DraftVersion, type: :model do - let(:legislation_draft_version) { build(:legislation_draft_version) } +describe Legislation::DraftVersion do + let(:legislation_draft_version) { build(:legislation_draft_version) } + + it_behaves_like "acts as paranoid", :legislation_draft_version it "is valid" do expect(legislation_draft_version).to be_valid