mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
fix rubocop issues
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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}"
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user