Skip to content

Commit

Permalink
resolve blocklength spec
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelglass committed Jan 3, 2020
1 parent f852521 commit 36abcd8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ RSpec/DescribeClass:
Exclude:
- spec/features/**/*
- spec/models/factory_spec.rb

Metrics/BlockLength:
Exclude:
- spec/**/*
- config/**/*
- db/migrate/*
- lib/tasks/**/*
12 changes: 3 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -58,7 +52,7 @@ RSpec/ContextWording:
RSpec/ExampleLength:
Enabled: false

# Offense count: 1142
# Offense count: 394
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Enabled: false
Expand Down Expand Up @@ -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
Expand Down
26 changes: 14 additions & 12 deletions app/controllers/events/attendees_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 << [
Expand Down

0 comments on commit 36abcd8

Please sign in to comment.