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
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xuan Trung Le
venjob
Commits
789decfc
Commit
789decfc
authored
Oct 30, 2017
by
Xuan Trung Le
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
eb32d5c8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
app/controllers/my_pages_controller.rb
+1
-1
app/models/user.rb
+4
-3
config/settings.yml
+1
-0
No files found.
app/controllers/my_pages_controller.rb
View file @
789decfc
...
...
@@ -9,7 +9,7 @@ class MyPagesController < ApplicationController
end
def
history
@jobs
=
current_user
.
viewed_jobs
.
includes
(
:apply_jobs
).
includes
(
:company
).
limit
(
20
)
@jobs
=
current_user
.
viewed_jobs
.
includes
(
:apply_jobs
).
includes
(
:company
).
limit
(
Settings
.
top
.
job_per_history_page
)
end
def
download_cv
...
...
app/models/user.rb
View file @
789decfc
...
...
@@ -48,9 +48,10 @@ class User < ApplicationRecord
end
def
my_jobs
Job
.
select
(
:'jobs.id'
,
:'jobs.name'
,
:'jobs.salary'
,
:'jobs.description'
,
:'apply_jobs.created_at'
,
:'companies.location'
).
joins
(
:company
,
:apply_jobs
).
where
(
apply_jobs:
{
user_id:
self
.
id
})
Job
.
select
(
:'jobs.id'
,
:'jobs.name'
,
:'jobs.salary'
,
:'jobs.description'
,
:'companies.location'
,
:'apply_jobs.created_at'
)
.
joins
(
:company
,
:apply_jobs
)
.
where
(
apply_jobs:
{
user_id:
id
})
end
private
...
...
config/settings.yml
View file @
789decfc
...
...
@@ -3,6 +3,7 @@ defaults: &defaults
job_per_page
:
5
industry_per_page
:
9
city_per_page
:
9
job_per_history_page
:
20
development
:
<<
:
*defaults
...
...
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