Skip to content

Feature/action mailer#28

Open
Graph1589 wants to merge 6 commits intodevelopfrom
feature/action-mailer
Open

Feature/action mailer#28
Graph1589 wants to merge 6 commits intodevelopfrom
feature/action-mailer

Conversation

@Graph1589
Copy link
Copy Markdown
Owner

No description provided.

@Graph1589 Graph1589 force-pushed the feature/action-mailer branch from 5d8b771 to 53a6527 Compare January 20, 2022 23:37
@Graph1589 Graph1589 force-pushed the feature/action-mailer branch from 53a6527 to da3f512 Compare January 20, 2022 23:49
task.update(task_params)

if task.update(task_params)
UserMailer.with({ task: task }).task_updated.deliver_now
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

где user?

task.destroy

if task.destroy
UserMailer.with({ task: task }).task_destroyed.deliver_now
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

user?

require 'test_helper'

class UserMailerTest < ActionMailer::TestCase
test 'task created' do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

task_updated и task_deleted тоже надо тестировать

task = Task.first
params = { task: task }

UserMailer.with(params).task_updated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

user?

@@ -1,13 +1,37 @@
<!DOCTYPE html>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

нет необходимости использовать erb и slim. Давай остановимся на слим

Comment thread config/routes.rb
resource :board, only: :show
resource :session, only: [:new, :create, :destroy]
resources :developers, only: [:new, :create]
resource :password_reset, only: [:new, :create, :edit, :update]
Copy link
Copy Markdown

@YJorge YJorge Aug 26, 2022

Choose a reason for hiding this comment

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

будет достаточно create для сброса

Comment thread config/routes.rb
resource :session, only: [:new, :create, :destroy]
resources :developers, only: [:new, :create]
resource :password_reset, only: [:new, :create, :edit, :update]
resource :password, only: [:edit, :update]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

password_controller?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

достаточно update для обновления

end

def create
@password_reset = PasswordResetForm.new(password_reset_params)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

password_reset_form. Глобальные переменные лучше не использовать

class AddResetToUsers < ActiveRecord::Migration[6.1]
def change
add_column :users, :reset_digest, :string
add_column :users, :reset_sent_at, :datetime
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

лучше expired_at

user.reset_sent_at.present? && (Time.current - user.reset_sent_at) <= 1.days
end

def self.clear_reset_digest(user)
Copy link
Copy Markdown

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