Skip to content

Feature/action mailer#29

Open
Leenday wants to merge 7 commits intodevelopfrom
feature/action_mailer
Open

Feature/action mailer#29
Leenday wants to merge 7 commits intodevelopfrom
feature/action_mailer

Conversation

@Leenday
Copy link
Owner

@Leenday Leenday commented Jan 5, 2023

No description provided.

@github-actions
Copy link

github-actions bot commented Jan 5, 2023

Uffizzi Preview Environment

☁️ https://app.uffizzi.com//github.com/Leenday/task_manager/pull/29

⚙️ Updating now by workflow run 3852834403.

What is Uffizzi? Learn more

def new; end

def create
@user = User.find_by(email: params.dig('user', 'email'))
Copy link

Choose a reason for hiding this comment

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

лучше через стронг параметры

@user = GlobalID::Locator.locate_signed(params[:token], for: 'password_reset')
if @user.nil?
redirect_to new_session_path
elsif @user.reset_password_token_digest != params[:token]
Copy link

Choose a reason for hiding this comment

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

Для валидации данных, поступающих в контроллер, используют формы

Copy link

Choose a reason for hiding this comment

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

  • пользователю необходимо сообщить что у него не так

validates :last_name, presence: true, length: { minimum: 2 }
validates :email, presence: true, uniqueness: true, format: { with: /\w*@{1}\w*/ }

def generate_token
Copy link

Choose a reason for hiding this comment

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

метод не относится к модели. Нужно вынести в отдельный сервис

html lang="en"
head
meta http-equiv="Content-Type" content="text/html; charset=utf-8"
title="Email template"
Copy link

Choose a reason for hiding this comment

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

кажется еще есть общие участки кода

DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres

MAILER_USERNAME: fake
Copy link

Choose a reason for hiding this comment

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

не очень решение. Пересобирать контейнер при добавлении/удалении переменных не очень хочется

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