Add API data to show/index views

This commit is contained in:
BrokenEagle
2020-01-04 01:51:37 +00:00
parent e8a96c1a2a
commit 223a6df5d8
60 changed files with 337 additions and 34 deletions

View File

@@ -44,6 +44,14 @@ class Ban < ApplicationRecord
q
end
module ApiMethods
def html_data_attributes
[:user_id, :banner_id, :expired?]
end
end
include ApiMethods
def self.prune!
expired.includes(:user).find_each do |ban|
ban.user.unban! if ban.user.ban_expired?