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
0
Merge Requests
0
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
Huỳnh Thiên Phước
venjob
Commits
18811449
Commit
18811449
authored
Sep 04, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move sign in validation to application controller
parent
6ccea578
Pipeline
#1069
failed with stages
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
32 deletions
+9
-32
app/controllers/application_controller.rb
+9
-0
app/controllers/favorite_jobs_controller.rb
+0
-9
app/controllers/history_jobs_controller.rb
+0
-9
app/controllers/job_applieds_controller.rb
+0
-7
app/controllers/users_controller.rb
+0
-7
No files found.
app/controllers/application_controller.rb
View file @
18811449
class
ApplicationController
<
ActionController
::
Base
class
ApplicationController
<
ActionController
::
Base
include
SessionsHelper
include
SessionsHelper
private
def
sign_in_validation
return
if
signed_in?
store_location
flash
[
:warning
]
=
Settings
.
user
.
warning_signin
redirect_to
login_path
end
end
end
app/controllers/favorite_jobs_controller.rb
View file @
18811449
...
@@ -32,13 +32,4 @@ class FavoriteJobsController < ApplicationController
...
@@ -32,13 +32,4 @@ class FavoriteJobsController < ApplicationController
respond_to
{
|
format
|
format
.
js
}
respond_to
{
|
format
|
format
.
js
}
end
end
private
def
sign_in_validation
return
if
signed_in?
store_location
flash
[
:warning
]
=
Settings
.
user
.
warning_signin
redirect_to
login_path
end
end
end
app/controllers/history_jobs_controller.rb
View file @
18811449
...
@@ -5,13 +5,4 @@ class HistoryJobsController < ApplicationController
...
@@ -5,13 +5,4 @@ class HistoryJobsController < ApplicationController
@count
=
current_user
.
histories
.
count
@count
=
current_user
.
histories
.
count
@history_jobs
=
current_user
.
histories
.
order_history
@history_jobs
=
current_user
.
histories
.
order_history
end
end
private
def
sign_in_validation
return
if
signed_in?
store_location
flash
[
:warning
]
=
Settings
.
user
.
warning_signin
redirect_to
login_path
end
end
end
app/controllers/job_applieds_controller.rb
View file @
18811449
...
@@ -52,13 +52,6 @@ class JobAppliedsController < ApplicationController
...
@@ -52,13 +52,6 @@ class JobAppliedsController < ApplicationController
private
private
def
sign_in_validation
return
if
signed_in?
store_location
flash
[
:warning
]
=
Settings
.
user
.
warning_signin
redirect_to
login_path
end
def
apply_params
def
apply_params
params
.
require
(
:job_applied
).
permit
(
:name
,
:email
,
:cv_user
)
params
.
require
(
:job_applied
).
permit
(
:name
,
:email
,
:cv_user
)
end
end
...
...
app/controllers/users_controller.rb
View file @
18811449
...
@@ -38,13 +38,6 @@ class UsersController < ApplicationController
...
@@ -38,13 +38,6 @@ class UsersController < ApplicationController
private
private
def
sign_in_validation
return
if
signed_in?
store_location
flash
[
:warning
]
=
Settings
.
user
.
warning_signin
redirect_to
login_path
end
def
user_params
def
user_params
params
[
:user
][
:password
]
=
change_pass_param
[
:new_password
]
if
change_pass_param
[
:new_password
].
present?
params
[
:user
][
:password
]
=
change_pass_param
[
:new_password
]
if
change_pass_param
[
:new_password
].
present?
params
.
require
(
:user
).
permit
(
:name
,
:email
,
:cv_user
,
:password
)
params
.
require
(
:user
).
permit
(
:name
,
:email
,
:cv_user
,
:password
)
...
...
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