Skip to content

Conversation

@AndySok
Copy link
Contributor

@AndySok AndySok commented Jun 29, 2020

Addresses #158. Edits the user mutation so that it can accept arrays of roles instead of singular roles. Links to stuyspec/cms#45, so both pull requests must be approved for the change to be properly implemented.

if args["role"] and role != nil and !@new_user.roles.include?(role)
@new_user.roles << role
args["role"].each do |role|
roley = Role.find_by(title: role)
Copy link
Member

Choose a reason for hiding this comment

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

There's a naming convention for variables in this case, and they're usually named with an @ before the name. In this instance, the name would be @role

@user.roles << role
@user.roles.clear
args["role"].each do |role|
roley = Role.find_by(title: role)
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above.

@AndySok
Copy link
Contributor Author

AndySok commented Jul 3, 2020

Yeah, renamed the variable so now it follows the norms

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.

2 participants