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

Chapter 11: Account activation #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Chapter 11: Account activation #11

wants to merge 1 commit into from

Conversation

boummm
Copy link
Owner

@boummm boummm commented Apr 12, 2019

56922809_1806875239414016_8806732141531496448_n

@boummm
Copy link
Owner Author

boummm commented Apr 12, 2019

ready

@boummm boummm force-pushed the chapter_11 branch 2 times, most recently from 9326864 to 0387595 Compare April 12, 2019 02:58
@@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.

Choose a reason for hiding this comment

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

k dùng thì xoá, để cmt cái này hơi nhiều

class AccountActivationsController < ApplicationController
def edit
user = User.find_by email: params[:email]
if user && !user.activated? && user.authenticated?(:activation, params[:id])

Choose a reason for hiding this comment

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

anh chưa chỉ chú cách dùng user&.method à ???

Copy link
Owner Author

Choose a reason for hiding this comment

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

ban đầu em chạy rubocop nó tự chỉnh cho rồi mà bh up lên lại về như cũ :<


def active user
user.activate
user.update_attributes activated: true, activated_at: Time.zone.now

Choose a reason for hiding this comment

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

sao vẫn dùng update_attributes

Choose a reason for hiding this comment

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

sử dụng Time.current nhé
nêu giúp anh sự khác biệt vs hiện tại nếu có

Copy link
Owner Author

Choose a reason for hiding this comment

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

em pull lên không hiểu sao nó bị về như cũ :(((
Time.zone được khởi chạy bởi ActiveSupport::Railtie thông qua active_support.initialize_time_zone nên nếu t xóa active_support.initialize_time_zone đi thì sẽ bị hiển thị thành nil trong khi Time.current vẫn ổn

end

def password_reset
@greeting = t("hi")

Choose a reason for hiding this comment

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

xoá đc ()

def password_reset
@greeting = t("hi")

mail to: "[email protected]"

Choose a reason for hiding this comment

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

đưa vào settings

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