diff --git a/app/models/user/ban_methods.rb b/app/models/user/ban_methods.rb index fffd4c31..07826b1b 100644 --- a/app/models/user/ban_methods.rb +++ b/app/models/user/ban_methods.rb @@ -1,10 +1,12 @@ +# frozen_string_literal: true + module User::BanMethods def permanently_banned? bans.current.first&.permanent? || false end def banned? - self.bans.current.count > 0 + bans.current.count.positive? end def unban diff --git a/db/migrate/20220626134554_remove_ban_related_field_from_users.rb b/db/migrate/20220626134554_remove_ban_related_field_from_users.rb index a338c58a..6e81d26a 100644 --- a/db/migrate/20220626134554_remove_ban_related_field_from_users.rb +++ b/db/migrate/20220626134554_remove_ban_related_field_from_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveBanRelatedFieldFromUsers < ActiveRecord::Migration[6.1] def change remove_column :users, :permanently_banned, :boolean, default: false diff --git a/lib/exporter.rb b/lib/exporter.rb index 58191699..b26ae9e5 100644 --- a/lib/exporter.rb +++ b/lib/exporter.rb @@ -34,13 +34,13 @@ class Exporter private 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 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 privacy_allow_anonymous_questions privacy_allow_public_timeline privacy_allow_stranger_answers 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 end