Enable soft_deletion of Banner::Translations

Also create missing banner model spec.
This commit is contained in:
Senén Rodero Rodríguez
2019-01-22 14:46:00 +01:00
committed by voodoorai2000
parent caa9e1cd49
commit 206f92b9fa
3 changed files with 23 additions and 0 deletions

View File

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

View File

@@ -98,7 +98,9 @@ ActiveRecord::Schema.define(version: 20190607160900) do
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.string "title" t.string "title"
t.text "description" t.text "description"
t.datetime "hidden_at"
t.index ["banner_id"], name: "index_banner_translations_on_banner_id", using: :btree t.index ["banner_id"], name: "index_banner_translations_on_banner_id", using: :btree
t.index ["hidden_at"], name: "index_banner_translations_on_hidden_at", using: :btree
t.index ["locale"], name: "index_banner_translations_on_locale", using: :btree t.index ["locale"], name: "index_banner_translations_on_locale", using: :btree
end end

View File

@@ -0,0 +1,15 @@
require "rails_helper"
describe Banner do
let(:banner) { build(:banner) }
describe "Concerns" do
it_behaves_like "acts as paranoid", :banner
end
it "is valid" do
expect(banner).to be_valid
end
end