diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c3304c55b..211419610 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude` -# on 2020-03-03 12:28:40 +0100 using RuboCop version 0.80.1. +# on 2020-03-29 11:26:15 +0200 using RuboCop version 0.80.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -79,6 +79,22 @@ RSpec/NestedGroups: Rails/SkipsModelValidations: Enabled: false +# Offense count: 10 +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/UniqueValidationWithoutIndex: + Exclude: + - 'app/models/authentication.rb' + - 'app/models/chapter.rb' + - 'app/models/chapter_leadership.rb' + - 'app/models/dietary_restriction.rb' + - 'app/models/organization_leadership.rb' + - 'app/models/profile.rb' + - 'app/models/region.rb' + - 'app/models/region_leadership.rb' + - 'app/models/rsvp_session.rb' + - 'app/models/survey.rb' + # Offense count: 147 Style/Documentation: Enabled: false diff --git a/Gemfile.lock b/Gemfile.lock index 1083311df..6e70dbc05 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -242,7 +242,7 @@ GEM parallel (1.19.1) parallel_tests (2.32.0) parallel - parser (2.7.0.3) + parser (2.7.0.5) ast (~> 2.4.0) pg (1.2.3) phantomjs (2.1.1.0) @@ -333,7 +333,8 @@ GEM unicode-display_width (>= 1.4.0, < 1.7) rubocop-performance (1.5.2) rubocop (>= 0.71.0) - rubocop-rails (2.4.2) + rubocop-rails (2.5.0) + activesupport rack (>= 1.1) rubocop (>= 0.72.0) rubocop-rspec (1.38.1) diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 987ba091b..49ff46cc0 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -41,8 +41,8 @@ it 'calculates attendances' do get :index, format: :json - users = JSON.parse(response.body)['data'].each_with_object({}) do |u, hsh| - hsh[u['global_id']] = u + users = JSON.parse(response.body)['data'].index_by do |u| + u['global_id'] end expect(users[user1.to_global_id.to_s]['volunteer_rsvp_count']).to eq(2)