-
Notifications
You must be signed in to change notification settings - Fork 52
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: keeps going invitees for recurring events #632
Conversation
Prior to this fix when computing the next event date we were resetting the status of every invitees. The status will now only be reset for non going users.
if !next_dates[:rescheduled] | ||
notify_invitees! | ||
notify_missing_invitees! | ||
end | ||
|
||
publish_update! |
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.
Not really related, but I think we should publish the update once we are done, and not randomly in the middle of the sequence
@@ -53,12 +53,14 @@ def set_next_date | |||
end | |||
end | |||
|
|||
publish_update! | |||
invitees.update_all(status: nil, notified: false) | |||
invitees.where.not(status: Invitee.statuses[:going]).update_all(status: nil, notified: false) |
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.
This is the main change. Instead of selectioning every invitees we filter out the going invitees
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 am wondering if there should be "going to this event" and "going to this and all future events" buttons like other calendars have.
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.
maybe, but for now we will assume it's by default "going to this and all future events"
@@ -41,11 +41,6 @@ def upsert_topic_custom_field | |||
end | |||
end | |||
|
|||
after_commit :reset_invitees_status, on: %i[create] |
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.
the only place where we call event_dates.create and trigger this hook, is in the event hook and we manually call the set_date which has the same behavior we just have modified in this commit. It was essentially doing two times the same work.
Prior to this fix when computing the next event date we were resetting the status of every invitees. The status will now only be reset for non going users.