-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
and update the app in necessary places
app/mailers/invitation_mailer.rb
Outdated
@@ -1,9 +1,9 @@ | |||
# frozen_string_literal: true | |||
|
|||
class InvitationMailer < ApplicationMailer | |||
def account_invitation(account_invitation) | |||
def account_invitation(account_invitation, current_user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def account_invitation(account_invitation, current_user) | |
def account_invitation(account_invitation) |
the user can be taken from account_invitation
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 %> |
There was a problem hiding this comment.
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.
app/views/my_accounts/show.html.erb
Outdated
@@ -1,4 +1,4 @@ | |||
<%= account.name %> | |||
<%= "#{current_user.name} #{account.email}"%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<%= "#{current_user.name} #{account.email}"%> | |
<%= [current_user.name, account.email].select(&:present?).join(" ") %> |
@andreybakanovsky please fix the failed test |
and update the app in necessary places