Appease the dog overlords

This commit is contained in:
Karina Kwiatek 2022-06-26 17:43:34 +02:00 committed by Karina Kwiatek
parent 53361eefdd
commit a857887398
3 changed files with 7 additions and 3 deletions

View File

@ -1,10 +1,12 @@
# frozen_string_literal: true
module User::BanMethods module User::BanMethods
def permanently_banned? def permanently_banned?
bans.current.first&.permanent? || false bans.current.first&.permanent? || false
end end
def banned? def banned?
self.bans.current.count > 0 bans.current.count.positive?
end end
def unban def unban

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class RemoveBanRelatedFieldFromUsers < ActiveRecord::Migration[6.1] class RemoveBanRelatedFieldFromUsers < ActiveRecord::Migration[6.1]
def change def change
remove_column :users, :permanently_banned, :boolean, default: false remove_column :users, :permanently_banned, :boolean, default: false

View File

@ -34,13 +34,13 @@ class Exporter
private private
def collect_user_info def collect_user_info
%i(answered_count asked_count comment_smiled_count commented_count %i[answered_count asked_count comment_smiled_count commented_count
confirmation_sent_at confirmed_at created_at profile_header profile_header_h profile_header_w profile_header_x profile_header_y confirmation_sent_at confirmed_at created_at profile_header profile_header_h profile_header_w profile_header_x profile_header_y
profile_picture_w profile_picture_h profile_picture_x profile_picture_y current_sign_in_at current_sign_in_ip profile_picture_w profile_picture_h profile_picture_x profile_picture_y current_sign_in_at current_sign_in_ip
id last_sign_in_at last_sign_in_ip locale id last_sign_in_at last_sign_in_ip locale
privacy_allow_anonymous_questions privacy_allow_public_timeline privacy_allow_stranger_answers privacy_allow_anonymous_questions privacy_allow_public_timeline privacy_allow_stranger_answers
privacy_show_in_search profile_header_file_name profile_picture_file_name privacy_show_in_search profile_header_file_name profile_picture_file_name
screen_name show_foreign_themes sign_in_count smiled_count updated_at).each do |f| screen_name show_foreign_themes sign_in_count smiled_count updated_at].each do |f|
@obj[f] = @user.send f @obj[f] = @user.send f
end end