bans: change expires_at field to duration.
Changes: * Change the `expires_at` field to `duration`. * Make moderators choose from a fixed set of standard ban lengths, instead of allowing arbitrary ban lengths. * List `duration` in seconds in the /bans.json API. * Dump bans to BigQuery. Note that some old bans have a negative duration. This is because their expiration date was before their creation date, which is because in 2013 bans were migrated to Danbooru 2 and the original ban creation dates were lost.
This commit is contained in:
@@ -9,11 +9,11 @@ class BanPolicy < ApplicationPolicy
|
||||
alias_method :destroy?, :bannable?
|
||||
|
||||
def permitted_attributes_for_create
|
||||
[:reason, :duration, :expires_at, :user_id, :user_name]
|
||||
[:reason, :duration, :user_id, :user_name]
|
||||
end
|
||||
|
||||
def permitted_attributes_for_update
|
||||
[:reason, :duration, :expires_at]
|
||||
[:reason, :duration]
|
||||
end
|
||||
|
||||
def html_data_attributes
|
||||
|
||||
Reference in New Issue
Block a user