Make it so that when a user removes their own vote, the vote is soft deleted (the is_deleted flag is set) instead of hard deleted. Changes: * Add is_deleted flag to comment votes. * Relax uniqueness constraint so you can have multiple deleted votes on the same comment. You can still only have one active vote on the comment. * Add `soft_delete` method to Deletable concern.
9 lines
119 B
Ruby
9 lines
119 B
Ruby
FactoryBot.define do
|
|
factory(:comment_vote) do
|
|
comment
|
|
user
|
|
score {1}
|
|
is_deleted { false }
|
|
end
|
|
end
|