Enable soft_deletion of Poll::Question::Translations
This commit is contained in:
committed by
voodoorai2000
parent
e451c4657c
commit
caa9e1cd49
@@ -0,0 +1,6 @@
|
|||||||
|
class AddHiddenAtToPollQuestionTranslations < ActiveRecord::Migration[4.2]
|
||||||
|
def change
|
||||||
|
add_column :poll_question_translations, :hidden_at, :datetime
|
||||||
|
add_index :poll_question_translations, :hidden_at
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1161,6 +1161,8 @@ ActiveRecord::Schema.define(version: 20190607160900) do
|
|||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.string "title"
|
t.string "title"
|
||||||
|
t.datetime "hidden_at"
|
||||||
|
t.index ["hidden_at"], name: "index_poll_question_translations_on_hidden_at", using: :btree
|
||||||
t.index ["locale"], name: "index_poll_question_translations_on_locale", using: :btree
|
t.index ["locale"], name: "index_poll_question_translations_on_locale", using: :btree
|
||||||
t.index ["poll_question_id"], name: "index_poll_question_translations_on_poll_question_id", using: :btree
|
t.index ["poll_question_id"], name: "index_poll_question_translations_on_poll_question_id", using: :btree
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ require "rails_helper"
|
|||||||
RSpec.describe Poll::Question, type: :model do
|
RSpec.describe Poll::Question, type: :model do
|
||||||
let(:poll_question) { build(:poll_question) }
|
let(:poll_question) { build(:poll_question) }
|
||||||
|
|
||||||
|
describe "Concerns" do
|
||||||
|
it_behaves_like "acts as paranoid", :poll_question
|
||||||
|
end
|
||||||
|
|
||||||
describe "#poll_question_id" do
|
describe "#poll_question_id" do
|
||||||
it "is invalid if a poll is not selected" do
|
it "is invalid if a poll is not selected" do
|
||||||
poll_question.poll_id = nil
|
poll_question.poll_id = nil
|
||||||
|
|||||||
Reference in New Issue
Block a user