From 02ecdf6acc8289813ca44c6e927600208727e530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 10 Oct 2020 20:35:30 +0200 Subject: [PATCH] Add and apply Style/AccessorGrouping rubocop rule This rule was added in Rubocop 0.87.0. We were already grouping accessors in most places. --- .rubocop.yml | 3 +++ app/models/user.rb | 4 +--- app/models/verification/management/email.rb | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index b8dd5c66c..f567ec525 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -368,6 +368,9 @@ Security/JSONLoad: Security/YAMLLoad: Enabled: true +Style/AccessorGrouping: + Enabled: true + Style/AndOr: Enabled: true diff --git a/app/models/user.rb b/app/models/user.rb index ac530d3a1..5daabdb50 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -89,9 +89,7 @@ class User < ApplicationRecord accepts_nested_attributes_for :organization, update_only: true - attr_accessor :skip_password_validation - attr_accessor :use_redeemable_code - attr_accessor :login + attr_accessor :skip_password_validation, :use_redeemable_code, :login scope :administrators, -> { joins(:administrator) } scope :moderators, -> { joins(:moderator) } diff --git a/app/models/verification/management/email.rb b/app/models/verification/management/email.rb index ed76e74d8..5348c97ba 100644 --- a/app/models/verification/management/email.rb +++ b/app/models/verification/management/email.rb @@ -1,9 +1,7 @@ class Verification::Management::Email include ActiveModel::Model - attr_accessor :document_type - attr_accessor :document_number - attr_accessor :email + attr_accessor :document_type, :document_number, :email validates :document_type, :document_number, :email, presence: true validates :email, format: { with: Devise.email_regexp }, allow_blank: true