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

Improve FollowersController#student_register. #13760

Merged
merged 3 commits into from
Mar 13, 2017

Conversation

ashercodeorg
Copy link
Contributor

No description provided.

if current_user
@user.errors.add(:username, "Please signout before proceeding")
else
@user.user_type = user_type == User::TYPE_TEACHER ? User::TYPE_TEACHER : User::TYPE_STUDENT
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that user_type was already set via L#56.


student_params = params[:user].permit([:name, :password, :gender, :age, :email, :hashed_email])
if user_type == User::TYPE_TEACHER
student_params.merge(params[:user].permit([:school, :full_address]))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This naming is rather misleading.

@ashercodeorg ashercodeorg merged commit 99b897a into staging Mar 13, 2017
@ashercodeorg ashercodeorg deleted the cleanupFollowersController branch March 13, 2017 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants