-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(exports): Add ability to generate data exports for sponsors #199
Conversation
data_export = build( | ||
:data_export, | ||
# 4:05:06 AM on 1/15/2020 in current time zone | ||
created_at: DateTime.new(2020, 01, 15, 4, 5, 6, timezone_offset), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/DateTime: Prefer Date or Time over DateTime.
Style/NumericLiteralPrefix: Use 0o for octal literals.
|
||
context "#file_basename" do | ||
should "use mix of type, date, and time" do | ||
timezone_offset = DateTime.now.offset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/DateTime: Prefer Date or Time over DateTime.
strip_attributes | ||
|
||
def file_basename | ||
time = created_at.strftime("%r").gsub(":", "-") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance/StringReplacement: Use tr instead of gsub.
|
||
POSSIBLE_TYPES = [ | ||
"sponsor_dump_rsvp_confirmed", | ||
"sponsor_dump_checked_in", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array.
@@ -0,0 +1,52 @@ | |||
class DataExport < ApplicationRecord | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning.
q.school_name, | ||
q.email, | ||
q.vcs_url, | ||
q.portfolio_url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array.
raise "Unknown attendee type: #{attendee_type}" | ||
end | ||
|
||
Dir.mktmpdir("data-export") do |dir| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/BlockLength: Block has too many lines. [50/25]
end | ||
|
||
data_export.update_attribute(:finished_at, Time.now) | ||
rescue => ex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/RescueStandardError: Avoid rescuing without specifying an error class.
Lint/UselessAssignment: Useless assignment to variable - ex.
Fixes #133