Enable soft_deletion of Banner::Translations
Also create missing banner model spec.
This commit is contained in:
committed by
voodoorai2000
parent
caa9e1cd49
commit
206f92b9fa
@@ -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
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
15
spec/models/banner_spec.rb
Normal file
15
spec/models/banner_spec.rb
Normal 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
|
||||||
Reference in New Issue
Block a user