fix rubocop issues

This commit is contained in:
Klaus Zanders
2024-11-19 13:00:20 +01:00
parent 250288c66a
commit 3f20102c7b
7 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ class ProjectsController < ApplicationController
:projects
end
def index # rubocop:disable Format/AbcSize
def index # rubocop:disable Metrics/AbcSize
respond_to do |format|
format.html do
flash.now[:error] = @query.errors.full_messages if @query.errors.any?
+2 -2
View File
@@ -29,13 +29,13 @@
require "digest/md5"
class Attachment < ApplicationRecord
enum status: {
enum :status, {
uploaded: 0,
prepared: 1,
scanned: 2,
quarantined: 3,
rescan: 4
}.freeze, _prefix: true
}, prefix: true
belongs_to :container, polymorphic: true
belongs_to :author, class_name: "User"
+2 -2
View File
@@ -46,11 +46,11 @@ class LdapAuthSource < ApplicationRecord
prepend ::Mixins::UniqueFinder
enum tls_mode: {
enum :tls_mode, {
plain_ldap: 0,
simple_tls: 1,
start_tls: 2
}.freeze, _default: :start_tls
}, default: :start_tls
validates :tls_mode, inclusion: { in: tls_modes.keys }
validates :host, :port, :attr_login, presence: true
+1 -2
View File
@@ -43,8 +43,7 @@ class Notification < ApplicationRecord
shared: 12
}.freeze
enum reason: REASONS,
_prefix: true
enum :reason, REASONS, _prefix: true
belongs_to :recipient, class_name: "User"
belongs_to :actor, class_name: "User"
+2 -2
View File
@@ -31,12 +31,12 @@ class Principal < ApplicationRecord
# Account statuses
# Disables enum scopes to include not_builtin (cf. Principals::Scopes::Status)
enum status: {
enum :status, {
active: 1,
registered: 2,
locked: 3,
invited: 4
}.freeze, _scopes: false
}, scopes: false
self.table_name = "#{table_name_prefix}users#{table_name_suffix}"
+1 -1
View File
@@ -174,7 +174,7 @@ class Project < ApplicationRecord
scopes :activated_time_activity,
:visible_with_activated_time_activity
enum status_code: {
enum :status_code, {
on_track: 0,
at_risk: 1,
off_track: 2,
+1 -1
View File
@@ -30,7 +30,7 @@ module Query::Timelines
extend ActiveSupport::Concern
included do
enum timeline_zoom_level: { days: 0, weeks: 1, months: 2, quarters: 3, years: 4, auto: 5 }
enum :timeline_zoom_level, { days: 0, weeks: 1, months: 2, quarters: 3, years: 4, auto: 5 }
validates :timeline_zoom_level, inclusion: { in: timeline_zoom_levels.keys }
serialize :timeline_labels, type: Hash