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

[Draft] Re send article recruit email #228

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zhang4952
Copy link
Member

No description provided.

zhang4952 added 4 commits May 15, 2019 19:00
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
@zhang4952 zhang4952 requested a review from revgum May 20, 2019 16:19
end
end
end
end

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

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]) }

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,

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],

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

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

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 }",

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)

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]

@zhang4952
Copy link
Member Author

fixes #223

@zhang4952 zhang4952 marked this pull request as draft April 15, 2020 14:52
@zhang4952 zhang4952 removed the request for review from revgum April 15, 2020 14:53
@zhang4952 zhang4952 changed the title Re send article recruit email [WIP] Re send article recruit email Oct 5, 2021
@zhang4952 zhang4952 changed the title [WIP] Re send article recruit email [Draft] Re send article recruit email Oct 5, 2021
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.

2 participants