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

Set interstitial last seen to future date when clearing school_info_id in users #18304

Merged
merged 2 commits into from Oct 11, 2017

Conversation

jopolsky
Copy link

@jopolsky jopolsky commented Oct 11, 2017

Setting the interstitial dialog to show in the future.

Related to: #18254

exit
end
end.parse!
puts "Called with options: #{options}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

if options[:actually_update]
user.last_seen_school_info_interstitial = DateTime.now + options[:interstitial_days]
user.school_info_id = nil
user.save!(validate: false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why skip validation? I'm guessing that's for the same reason as this, in which case please add a small comment.

As an aside, we really should try to fix our users table so they all pass validation at some point :(

if ACTUALLY_UPDATE
user.update!(school_info_id: nil)
if options[:actually_update]
user.last_seen_school_info_interstitial = DateTime.now + options[:interstitial_days]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we setting it to today (or the future)? Is this just to give them at least a week before asking again?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marina asked that we delay the popup until after the school lookup is added. However, they need to fix the data now in order to run the other script that sets the school_info_id based on past PD enrollments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. We will (obviously) need to make sure we add the school lookup before 7 days from whenever we set these to.

Copy link
Author

@jopolsky jopolsky Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are going to future date it, 35 days from now on November 15th. With the future date the number of days is negative and the check will return false, which means don't show.

@jopolsky jopolsky merged commit d5543a6 into staging Oct 11, 2017
@jopolsky jopolsky deleted the set-interstitial-to-future-date branch October 11, 2017 19:32
@jopolsky jopolsky changed the title Set interstitial last seen to future date when clearing school_info_i… Set interstitial last seen to future date when clearing school_info_id in users Oct 11, 2017
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.

None yet

2 participants