Add deactivates_at date to user blocks
Block deactivation dates that take needs_view-block views into account were derived using updated_at. This was possible because inactive blocks couldn't be edited and their updated_at date wouldn't change. With editing of inactive blocks enabled deactivation date needs to be saved explicitly.
This commit is contained in:
parent
41b81bd393
commit
cff4c63713
8 changed files with 165 additions and 15 deletions
|
@ -2,12 +2,14 @@ FactoryBot.define do
|
|||
factory :user_block do
|
||||
sequence(:reason) { |n| "User Block #{n}" }
|
||||
ends_at { Time.now.utc + 1.day }
|
||||
deactivates_at { ends_at }
|
||||
|
||||
user
|
||||
creator :factory => :moderator_user
|
||||
|
||||
trait :needs_view do
|
||||
needs_view { true }
|
||||
deactivates_at { nil }
|
||||
end
|
||||
|
||||
trait :expired do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue