diff --git a/.rubocop.yml b/.rubocop.yml index 3a9677bcb..dd34379f0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -48,3 +48,10 @@ RSpec/DescribeClass: Exclude: - spec/features/**/* - spec/models/factory_spec.rb + +Metrics/BlockLength: + Exclude: + - spec/**/* + - config/**/* + - db/migrate/* + - lib/tasks/**/* \ No newline at end of file diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e659ec6af..9ed2b20ce 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-01-02 21:39:09 +0100 using RuboCop version 0.78.0. +# on 2020-01-03 11:33:09 +0100 using RuboCop version 0.78.0. # 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 @@ -10,12 +10,6 @@ Metrics/AbcSize: Max: 249 -# Offense count: 186 -# Configuration parameters: CountComments, ExcludedMethods. -# ExcludedMethods: refine -Metrics/BlockLength: - Max: 596 - # Offense count: 5 # Configuration parameters: CountComments, Max. Metrics/ClassLength: @@ -58,7 +52,7 @@ RSpec/ContextWording: RSpec/ExampleLength: Enabled: false -# Offense count: 1142 +# Offense count: 394 # Configuration parameters: AssignmentOnly. RSpec/InstanceVariable: Enabled: false @@ -92,7 +86,7 @@ Style/Documentation: Style/IfUnlessModifier: Enabled: false -# Offense count: 811 +# Offense count: 807 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https diff --git a/app/controllers/events/attendees_controller.rb b/app/controllers/events/attendees_controller.rb index 67f4e3dcb..14be00ed6 100644 --- a/app/controllers/events/attendees_controller.rb +++ b/app/controllers/events/attendees_controller.rb @@ -31,20 +31,22 @@ def find_event @event = Event.find_by(id: params[:event_id]) end + HEADER = [ + 'Name', + 'Attending As', + 'Custom Question Answer', + 'Dietary Info', + 'Childcare Info', + 'Job Details', + 'Gender', + 'Plus-One Host', + 'Waitlisted', + 'Waitlist Position' + ].freeze + def attendee_csv_data(rsvps) CSV.generate do |csv| - csv << [ - 'Name', - 'Attending As', - 'Custom Question Answer', - 'Dietary Info', - 'Childcare Info', - 'Job Details', - 'Gender', - 'Plus-One Host', - 'Waitlisted', - 'Waitlist Position' - ] + csv << HEADER rsvps.includes(:user).joins(:bridgetroll_user).order('users.first_name ASC, users.last_name ASC').each do |rsvp| csv << [