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

Update user school info from submitted teacher application #19977

Merged
merged 2 commits into from Jan 13, 2018

Conversation

aoby
Copy link
Contributor

@aoby aoby commented Jan 12, 2018

@aoby aoby requested review from Hamms and mehalshah January 12, 2018 19:40
@aoby
Copy link
Contributor Author

aoby commented Jan 12, 2018

def update_user_school_info!
if school_id || user.school_info.try(&:school).nil?
school_info = get_duplicate_school_info(school_info_attr) || SchoolInfo.create!(school_info_attr)
user.update!(school_info: school_info)
Copy link
Contributor

Choose a reason for hiding this comment

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

If the user is in an invalid state (and a number of our users are in such a state) then this update will fail for reasons unrelated to school_info I think.

I hate to suggest it but update_column might be justified here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Will change.

As an aside, I'd really like for us to fix the user data

Copy link
Contributor

@Hamms Hamms left a comment

Choose a reason for hiding this comment

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

LGTM!

@aoby aoby merged commit 8a5d5d5 into staging Jan 13, 2018
@aoby aoby deleted the teacher-application-update-user-info branch January 13, 2018 00: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

3 participants