Commit 90635aef by Thanh Hung Pham

Fix comment- current_user.applies

parent fa9f23e6
class JobsController < ApplicationController class JobsController < ApplicationController
def applied_jobs def applied_jobs
@applied_jobs = Apply.where(user_id: current_user.id) @applied_jobs = current_user.applies
end end
def detail def detail
......
class User < ApplicationRecord class User < ApplicationRecord
attr_accessor :skip_password_validation, :skip_fullname_validation, :upload attr_accessor :skip_password_validation, :skip_fullname_validation, :upload
has_many :applies
# Include default devise modules. Others available are: # Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable # :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :recoverable, :rememberable, :trackable,
:confirmable, :lockable :confirmable, :lockable
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX }, uniqueness: true validates :email, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX }, uniqueness: true
validates_presence_of :fullname, message: "can't be empty", unless: :skip_fullname_validation validates_presence_of :fullname, message: "can't be empty", unless: :skip_fullname_validation
......
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