[Cleanup] Remove takedown PRETTY_STATUS

This never worked because of string/symbol key mismatch
This commit is contained in:
Earlopain 2023-06-28 17:14:58 +02:00
parent 3b775e48bd
commit 3b26b0d30c
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
2 changed files with 7 additions and 13 deletions

View File

@ -1,10 +1,12 @@
module TakedownsHelper
def pretty_takedown_status(takedown)
status = takedown.pretty_status
classes = {'inactive' => 'sect_grey',
'denied' => 'sect_red',
'partial' => 'sect_green',
'approved' => 'sect_green'}
status = takedown.status.capitalize
classes = {
"inactive" => "sect_grey",
"denied" => "sect_red",
"partial" => "sect_green",
"approved" => "sect_green",
}
tag.td(status, class: classes[takedown.status])
end
end

View File

@ -17,14 +17,6 @@ class Takedown < ApplicationRecord
after_validation :normalize_deleted_post_ids
before_save :update_post_count
PRETTY_STATUS = {
'partial': 'Partially Approved'
}
def pretty_status
PRETTY_STATUS.fetch(status, status.capitalize)
end
def initialize_fields
self.status = "pending"
self.vericode = Takedown.create_vericode