Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
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
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thanh Hung Pham
veNJOB
Commits
90635aef
Commit
90635aef
authored
Jul 24, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comment- current_user.applies
parent
fa9f23e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
app/controllers/jobs_controller.rb
+1
-1
app/models/user.rb
+4
-0
No files found.
app/controllers/jobs_controller.rb
View file @
90635aef
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
...
...
app/models/user.rb
View file @
90635aef
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment