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

feat(user): add user name #39

Merged
merged 5 commits into from
Aug 30, 2023
Merged

feat(user): add user name #39

merged 5 commits into from
Aug 30, 2023

Conversation

andreybakanovsky
Copy link
Contributor

and update the app in necessary places

and update the app in necessary places
@@ -1,9 +1,9 @@
# frozen_string_literal: true

class InvitationMailer < ApplicationMailer
def account_invitation(account_invitation)
def account_invitation(account_invitation, current_user)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def account_invitation(account_invitation, current_user)
def account_invitation(account_invitation)

the user can be taken from account_invitation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

account_invitation contains only invitee data.
current_user is an inviter whose was pass to the mailer due to the name. The inviter name helps invitee recognize the person in an email invitation

Copy link
Member

Choose a reason for hiding this comment

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

@andreybakanovsky what about the user_id column inside account_invitation model? Isn't it the user who sent the invite?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it.

@@ -10,7 +10,12 @@
<%= render "devise/shared/error_messages", resource: resource %>

<div class="field">
<%= f.email_field_with_label :email, autofocus: true, autocomplete: "email" %>
<%= f.label :name %>
Copy link
Member

Choose a reason for hiding this comment

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

remove it from the registration page. it's ok to add in on edit profile page though.

@@ -1,4 +1,4 @@
<%= account.name %>
<%= "#{current_user.name} #{account.email}"%>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<%= "#{current_user.name} #{account.email}"%>
<%= [current_user.name, account.email].select(&:present?).join(" ") %>

@ka8725
Copy link
Member

ka8725 commented Aug 30, 2023

@andreybakanovsky please fix the failed test

@ka8725 ka8725 merged commit b5b8170 into master Aug 30, 2023
2 checks passed
@ka8725 ka8725 deleted the dev/add-user-name branch August 30, 2023 20:48
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.

3 participants