Skip to content
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

Merged
merged 1 commit into from
Feb 5, 2020

Conversation

sman591
Copy link
Member

@sman591 sman591 commented Feb 5, 2020

Fixes #133

Screen Shot 2020-02-05 at 10 13 10 AM

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),
Copy link
Contributor

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
Copy link
Contributor

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(":", "-")
Copy link
Contributor

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",
Copy link
Contributor

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.

app/models/data_export.rb Show resolved Hide resolved
@@ -0,0 +1,52 @@
class DataExport < ApplicationRecord

Copy link
Contributor

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,
Copy link
Contributor

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|
Copy link
Contributor

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
Copy link
Contributor

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.

@sman591 sman591 merged commit 70b1336 into master Feb 5, 2020
@sman591 sman591 deleted the data-exports branch February 5, 2020 18:29
sman591 pushed a commit that referenced this pull request Feb 5, 2020
# [1.22.0](v1.21.1...v1.22.0) (2020-02-05)

### Features

* **exports:** Add ability to generate data exports for sponsors ([#199](#199)) ([](70b1336)), closes [#133](#133)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turn resume collection script into background job
2 participants