From ed0f55c45f0608799a28c9c524bbd9d8987b95db Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Thu, 18 Feb 2016 14:40:24 +0100 Subject: [PATCH] Fix remaining rubocop problems --- .rubocop.yml | 3 +++ .rubocop_todo.yml | 5 ----- app/models/registration.rb | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 31f92f4b..512bef00 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -94,6 +94,9 @@ Style/AndOr: Metrics/BlockNesting: Max: 4 +Metrics/ClassLength: + Max: 550 + # avoid redundunt curly braces when it is obvious that hash is used Style/BracesAroundHashParameters: Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 984ff321..a42515c3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -22,11 +22,6 @@ Lint/IneffectiveAccessModifier: Metrics/AbcSize: Max: 75 -# Offense count: 7 -# Configuration parameters: CountComments. -Metrics/ClassLength: - Max: 514 - # Offense count: 12 Metrics/CyclomaticComplexity: Max: 12 diff --git a/app/models/registration.rb b/app/models/registration.rb index 69af5402..2f2d5c68 100644 --- a/app/models/registration.rb +++ b/app/models/registration.rb @@ -52,7 +52,7 @@ class Registration < ActiveRecord::Base end def registration_limit_not_exceed - if self.conference.registration_limit>0 && self.conference.registrations(:reload).count >= self.conference.registration_limit + if conference.registration_limit > 0 && conference.registrations(:reload).count >= conference.registration_limit errors.add(:base, 'Registration limit exceeded') end end