Commit dd88deb0 by Xuan Trung Le Committed by Xuan Trung Le

fix bugs

parent aff6836e
...@@ -7,11 +7,8 @@ class JobsController < ApplicationController ...@@ -7,11 +7,8 @@ class JobsController < ApplicationController
end end
def show def show
<<<<<<< 28f7fab9b8eeffd0552745bdf048484097ac3362
clear_session_candidate clear_session_candidate
=======
current_user.view(Job.find(params[:id])) if current_user current_user.view(Job.find(params[:id])) if current_user
>>>>>>> add history page
end end
def city def city
......
...@@ -37,22 +37,14 @@ class User < ApplicationRecord ...@@ -37,22 +37,14 @@ class User < ApplicationRecord
liked_jobs.include?(job) liked_jobs.include?(job)
end end
private
def password_required?
return false if skip_validation
super
end
def view(job) def view(job)
viewed_jobs << job unless viewed_jobs.include?(job) viewed_jobs << job unless viewed_jobs.include?(job)
end end
def like(job) private
liked_jobs << job unless liked_jobs.include?(job)
end
def unlike(job) def password_required?
liked_jobs.delete(job.id) return false if skip_validation
super
end end
end end
class UsersJob < ApplicationRecord
belongs_to :user
belongs_to :job
end
class CreateUsersJobs < ActiveRecord::Migration[5.1]
def change
create_table :users_jobs do |t|
t.references :user, foreign_key: true
t.references :job, foreign_key: true
t.string :action
t.timestamps
end
end
end
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 to comment