Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
sample_app
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Đường Sỹ Hoàng
  • sample_app
  • Merge Requests
  • !10

Merged
Opened Nov 19, 2019 by Đường Sỹ Hoàng@hoangds 
  • Report abuse
Report abuse

Account activation

×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b account-activation origin/account-activation

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff account-activation

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 4
  • Commits 7
  • Changes 25
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 19, 2019
    Last updated by Đường Sỹ Hoàng Nov 19, 2019
    app/models/user.rb
    51 end
    52
    53 # Activates an account.
    54 def activate
    55 update_columns(activated: true, activated_at: Time.zone.now)
    56 end
    57
    58 # Sends activation email.
    59 def send_activation_email
    60 UserMailer.account_activation(self).deliver_now
    61 end
    62
    63 private
    64
    65 # Converts email to all lower-case.
    66 def downcase_email
    • Son Do Hong @sondh commented Nov 19, 2019
      Master

      indent, dòng này viết thẳng private

      Edited Nov 19, 2019
      indent, dòng này viết thẳng private
    • Đường Sỹ Hoàng @hoangds commented Nov 19, 2019
      Master

      đã sửa anh check rồi merge giùm em.

      đã sửa anh check rồi merge giùm em.
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 3 of the diff

      Nov 19, 2019

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/10/diffs?diff_id=4356&start_sha=9a5d99274cb2c3a311a52e65c965b39f35864efc#4ed0c03b53dbc8320da88e7887465514cd9e90a4_66_66)
      Toggle commit list
    Please register or sign in to reply
  • Đường Sỹ Hoàng @hoangds

    resolved all discussions

    Nov 19, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • 9a5d9927 - Fixed indentation

    Compare with previous version

    Nov 19, 2019

    added 1 commit

    • 9a5d9927 - Fixed indentation

    Compare with previous version

    added 1 commit * 9a5d9927 - Fixed indentation [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/10/diffs?diff_id=4355&start_sha=2232576e3c9edc3bc2f96c1fb1c6eddf98e7cb04)
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • 6964fc80 - Fixed identation

    Compare with previous version

    Nov 19, 2019

    added 1 commit

    • 6964fc80 - Fixed identation

    Compare with previous version

    added 1 commit * 6964fc80 - Fixed identation [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/10/diffs?diff_id=4356&start_sha=9a5d99274cb2c3a311a52e65c965b39f35864efc)
    Toggle commit list
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 19, 2019
    Last updated by Đường Sỹ Hoàng Nov 19, 2019
    app/models/user.rb
    40 42 def forget
    41 43 update_attribute(:remember_digest, nil)
    42 44 end
    43 end
    44 45
    46 # Returns true if the given token matches the digest.
    47 def authenticated?(attribute, token)
    48 digest = send("#{attribute}_digest")
    49 return false if digest.nil?
    50 BCrypt::Password.new(digest).is_password?(token)
    51 end
    52
    53 # Activates an account.
    54 def activate
    55 update_columns(activated: true, activated_at: Time.zone.now)
    • Son Do Hong @sondh commented Nov 19, 2019
      Master

      dùng Time.current sẽ an toàn hơn dùng Time.zone

      dùng `Time.current` sẽ an toàn hơn dùng `Time.zone`
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 4 of the diff

      Nov 19, 2019

      changed this line in version 4 of the diff

      changed this line in [version 4 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/10/diffs?diff_id=4357&start_sha=6964fc805a59dc13cfdae46df2abc86edb2cbcd9#4ed0c03b53dbc8320da88e7887465514cd9e90a4_55_55)
      Toggle commit list
    Please register or sign in to reply
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • 0a769f20 - Changed method Time

    Compare with previous version

    Nov 19, 2019

    added 1 commit

    • 0a769f20 - Changed method Time

    Compare with previous version

    added 1 commit * 0a769f20 - Changed method Time [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/10/diffs?diff_id=4357&start_sha=6964fc805a59dc13cfdae46df2abc86edb2cbcd9)
    Toggle commit list
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Nov 19, 2019
    Last updated by Đường Sỹ Hoàng Nov 19, 2019
    app/models/user.rb
    1 1 class User < ApplicationRecord
    2 2 VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
    3 3
    4 attr_accessor :remember_token
    4 attr_accessor :remember_token, :activation_token
    5 5
    6 6 validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX }
    7 7 validates :name, presence: true, length: { maximum: 50 }, uniqueness: { case_sensitive: false }
    • Son Do Hong @sondh commented Nov 19, 2019
      Master

      uniqueness: { case_sensitive: false }

      Sửa validate này cho email, không phải cho name. Hồi chapter 6 mình làm sai

      `uniqueness: { case_sensitive: false }` Sửa validate này cho email, không phải cho name. Hồi chapter 6 mình làm sai
    • Đường Sỹ Hoàng @hoangds

      changed this line in version 5 of the diff

      Nov 19, 2019

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/10/diffs?diff_id=4358&start_sha=0a769f2058857ebe87c0993103dd7af16c424bbc#4ed0c03b53dbc8320da88e7887465514cd9e90a4_7_6)
      Toggle commit list
    Please register or sign in to reply
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • 793ccf28 - Fixed validate

    Compare with previous version

    Nov 19, 2019

    added 1 commit

    • 793ccf28 - Fixed validate

    Compare with previous version

    added 1 commit * 793ccf28 - Fixed validate [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/10/diffs?diff_id=4358&start_sha=0a769f2058857ebe87c0993103dd7af16c424bbc)
    Toggle commit list
  • Đường Sỹ Hoàng @hoangds

    added 1 commit

    • 7c9768df - Changed time current method

    Compare with previous version

    Nov 19, 2019

    added 1 commit

    • 7c9768df - Changed time current method

    Compare with previous version

    added 1 commit * 7c9768df - Changed time current method [Compare with previous version](https://gitlab.zigexn.vn/hoangds/sample_app/merge_requests/10/diffs?diff_id=4359&start_sha=793ccf28d80d50d59808266d306c463ac4153a25)
    Toggle commit list
  • Son Do Hong @sondh

    mentioned in commit ab0d9395

    Nov 19, 2019

    mentioned in commit ab0d9395

    mentioned in commit ab0d9395d259104fa90a3b0d51ddef6adb4a9f69
    Toggle commit list
  • Son Do Hong @sondh

    merged

    Nov 19, 2019

    merged

    merged
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Son Do Hong
Assignee
Son Do Hong @sondh
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: hoangds/sample_app!10
×

Revert this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.