Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
V
VeNJOB
  • 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
  • Nguyen Ngoc Nghia
  • VeNJOB
  • Merge Requests
  • !23

Merged
Opened Mar 06, 2020 by Nguyen Ngoc Nghia@nghiann 
  • Report abuse
Report abuse

Feature/favorited jobs

×

Check out, review, and merge locally

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

git fetch origin
git checkout -b feature/favorited_jobs origin/feature/favorited_jobs

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 feature/favorited_jobs

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 3
  • Commits 6
  • Changes 12
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Van Hau Le
    @haulv started a discussion on the diff Mar 10, 2020
    Resolved by Nguyen Ngoc Nghia Jul 28, 2020
    app/controllers/favorites_controller.rb 0 → 100644
    1 class FavoritesController < ApplicationController
    2 before_action :authenticate_user!, only: [:favorite, :unfavorite]
    3
    4 def favorite
    5 redirect_to jobs_path if params[:job_id].blank?
    6 job_id = params[:job_id]
    7
    8 if get_user_job
    • Van Hau Le @haulv commented Mar 10, 2020
      Master

      @nghiann assign return value of method to variable, not use it directly

      @nghiann assign return value of method to variable, not use it directly
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on the diff Mar 10, 2020
    Resolved by Nguyen Ngoc Nghia Jul 28, 2020
    app/controllers/favorites_controller.rb 0 → 100644
    1 class FavoritesController < ApplicationController
    2 before_action :authenticate_user!, only: [:favorite, :unfavorite]
    3
    4 def favorite
    5 redirect_to jobs_path if params[:job_id].blank?
    6 job_id = params[:job_id]
    7
    8 if get_user_job
    9 @favorite_jobs = get_user_job.update(favorited_at: Time.current)
    10 else
    11 @favorite_jobs = UserJob.create!(user_id: current_user.id, job_id: job_id, favorited_at: Time.current)
    12 end
    • Van Hau Le @haulv commented Mar 10, 2020
      Master

      @nghiann

      @favorite_job = UserJob.find_or_initialize_by(user_id: current_user.id, job_id: job_id)
      unless @favorite_job.save!
        render json: {} 
      end
      
      Edited Mar 10, 2020 by Van Hau Le
      @nghiann ``` ruby @favorite_job = UserJob.find_or_initialize_by(user_id: current_user.id, job_id: job_id) unless @favorite_job.save! render json: {} end ```
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Mar 10, 2020
    Automatically resolved by Nguyen Ngoc Nghia with a push Jul 28, 2020
    app/helpers/job_helper.rb
    7 7 def job_applied_at(job)
    8 8 job.user_jobs.find_by(user_id: current_user.id).applied_at
    9 9 end
    10
    11 def verify_favorited_job
    12 UserJob.where.not(favorited_at: nil).find_by(user_id: current_user.id, job_id: @job.id)
    13 end
    14
    15 def verify_applied_job
    16 UserJob.where.not(applied_at: nil).find_by(user_id: current_user.id, job_id: @job.id)
    • Van Hau Le @haulv commented Mar 10, 2020
      Master

      @nghiann

      UserJob.find_by(user_id: current_user.id, job_id: @job.id)&.applied_at
      @nghiann ``` UserJob.find_by(user_id: current_user.id, job_id: @job.id)&.applied_at ```
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 2 of the diff

      Jul 28, 2020

      changed this line in version 2 of the diff

      changed this line in [version 2 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/23/diffs?diff_id=4866&start_sha=de91696f6a3561ebc4eb6d348f586a2d95f79f5a#f595945add42f9b111acd113e6cbc743380281dd_16_16)
      Toggle commit list
    Please register or sign in to reply
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • dd0b8447 - fix reviews

    Compare with previous version

    Jul 28, 2020

    added 1 commit

    • dd0b8447 - fix reviews

    Compare with previous version

    added 1 commit * dd0b8447 - fix reviews [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/23/diffs?diff_id=4866&start_sha=de91696f6a3561ebc4eb6d348f586a2d95f79f5a)
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    resolved all discussions

    Jul 28, 2020

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    mentioned in commit 97e95e9f

    Jul 28, 2020

    mentioned in commit 97e95e9f

    mentioned in commit 97e95e9f62a51bb1777f980defd668fde6e16c50
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    merged

    Jul 28, 2020

    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
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: nghiann/VeNJOB!23
×

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.