-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Draft] Re send article recruit email #228
base: main
Are you sure you want to change the base?
Conversation
2. Add resend article recruit email to event and publication model 3. Add resend method in mailer 4. fix error in calling update method in publication model
end | ||
end | ||
end | ||
end |
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/TrailingBlankLines: Final newline missing.
event :await_claim do | ||
transitions from: :recruiting_authors, to: :awaiting_claim | ||
transitions from: [:recruiting_authors, :resending_recruiting_authors], to: :awaiting_claim |
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/SymbolArray: Use %i or %I for an array of symbols.
RESEND_EMAIL_ARTICLE_RECRUIT = { name: 'Resend article recruit with email saved in AuthorPublication', | ||
status: STARTED[:name], | ||
restartable: true, | ||
restartable_state: JSON.dump(method: RESTARTABLE_METHODS[:resend_email_article_recruit]) } |
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/AlignHash: Align the elements of a hash literal if they span more than one line.
@@ -53,6 +54,10 @@ class Event < ActiveRecord::Base | |||
status: STARTED[:name], | |||
restartable: true, | |||
restartable_state: JSON.dump(method: RESTARTABLE_METHODS[:email_article_recruit]) } | |||
RESEND_EMAIL_ARTICLE_RECRUIT = { name: 'Resend article recruit with email saved in AuthorPublication', | |||
status: STARTED[:name], | |||
restartable: true, |
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/AlignHash: Align the elements of a hash literal if they span more than one line.
@@ -53,6 +54,10 @@ class Event < ActiveRecord::Base | |||
status: STARTED[:name], | |||
restartable: true, | |||
restartable_state: JSON.dump(method: RESTARTABLE_METHODS[:email_article_recruit]) } | |||
RESEND_EMAIL_ARTICLE_RECRUIT = { name: 'Resend article recruit with email saved in AuthorPublication', | |||
status: STARTED[:name], |
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/AlignHash: Align the elements of a hash literal if they span more than one line.
rescue => e | ||
msg = 'EmailArticleRecruitJob.perform' | ||
NotificationManager.log_exception(logger, msg, e) | ||
event.error(restartable: true, message: "#{msg} : #{e.message}") if event |
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/SafeNavigation: Use safe navigation (&.) instead of checking if an object exists before calling the method.
status: Event::EMAIL[:name] | ||
) | ||
publication.await_claim! | ||
rescue => e |
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.
|
||
event.update( | ||
publication: publication, | ||
message: "Initiated by #{current_user ? current_user[:email] : system_email }", |
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/SpaceInsideStringInterpolation: Space inside string interpolation detected.
# Defaults to 0 | ||
# job_options retry: 0 | ||
|
||
def perform(publication:, current_user: nil, previous_event: nil) |
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/AbcSize: Assignment Branch Condition size for perform is too high. [34.32/15]
Metrics/CyclomaticComplexity: Cyclomatic complexity for perform is too high. [9/6]
Metrics/MethodLength: Method has too many lines. [26/10]
Metrics/PerceivedComplexity: Perceived complexity for perform is too high. [9/7]
fixes #223 |
No description provided.