-
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
Feature/operator documents new notifications #485
Conversation
end | ||
|
||
def expired_documents(operator, user, documents) | ||
@documents = documents.sort_by { |d| [d.fmu&.name || "_", d.required_operator_document.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.
since this is used twice maybe there could be a decorator for the sorting name, or even a comparable method for docs. Well, it's not super important. Maybe it's not worth the trouble.
@@ -31,7 +31,7 @@ def generate_reset_url(user) | |||
|
|||
def generate_reset_token(user) | |||
token, hashed = Devise.token_generator.generate(User, :reset_password_token) | |||
user.update(reset_password_token: hashed, reset_password_sent_at: DateTime.now) | |||
user.update!(reset_password_token: hashed, reset_password_sent_at: DateTime.now) unless user.new_record? # workaround for mailer previews |
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.
mmm.. I didn't get this.
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.
I think I had some validations errors here as in mailer's previews I'm not using persisted data, just User.new
entity. I want to just get the reset token here without saving in db.
@@ -217,4 +219,18 @@ def reason_or_file | |||
errors.add(:base, "File must be present or reason when document is non applicable") | |||
end | |||
end | |||
|
|||
def notify_about_changes |
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.
mmm.. from the task in Pivotal it looks like the goal is to notify when the documents are ready to be reviewed.
Like, the operators submitted them and the admins should review them.
But here the task tells the operators that their documents were reviewed.
Maybe the description of the task in Pivotal is not very clear.
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.
I think you looked at wrong PT task. This one is "Set up email notifications to alert private sector users when their documents have been published or if they have been rejected", there is another one for notifying admins that document is ready for review (I will add a new PR today for it).
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.
Yup. I probably checked the wrong task.
All good.
ecdd106
to
76ec6e8
Compare
574f871
to
3995812
Compare
Adding new notifications when operator document changes status.
PT: https://www.pivotaltracker.com/story/show/187126380