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

standardize capitalization of 'Please Explain' in pd applications #21488

Merged
merged 4 commits into from Apr 3, 2018

Conversation

clareconstantine
Copy link

No description provided.

@mehalshah
Copy link
Contributor

Add a script to standardize the capitalizations for already-submitted applications

Copy link
Contributor

@mehalshah mehalshah left a comment

Choose a reason for hiding this comment

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

This looks good. You should get numbers on how many teacher applications and principal applications you will be updating before running this

# then update, save, and score its corresponding teacher application
Pd::Application::PrincipalApproval1819Application.find_each do |principal_application|
if principal_application.form_data.include?("(please explain)")
principal_application.form_data = principal_application.form_data.gsub("(please explain)", "(Please Explain)")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine. There's also an update_form_data_hash but since this is just a gsub its fine

principal_application.form_data = principal_application.form_data.gsub("(please explain)", "(Please Explain)")
principal_application.save
if principal_application.errors
puts "principal app: #{principal_application.id} errors: #{principal_application.errors.full_messages}"
Copy link
Contributor

Choose a reason for hiding this comment

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

If you have an error here, consider not doing anything else with this application.

@clareconstantine clareconstantine merged commit b20c4f7 into staging Apr 3, 2018
@clareconstantine clareconstantine deleted the standardize_capitalization branch June 6, 2018 18:34
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