Feature/favorited jobs
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
-
-
-
-
resolved all discussions
Toggle commit list -
merged
Toggle commit list
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.
| 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 | |
Please
register
or
sign in
to reply
|
||
| 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 | |
|
||
| 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) | |
|
||
added 1 commit
resolved all discussions
resolved all discussions
mentioned in commit 97e95e9f
mentioned in commit 97e95e9f
merged
merged