Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_thanhnd
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
3
Merge Requests
3
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
thanhnd
venjob_thanhnd
Commits
0ebcc9ac
Commit
0ebcc9ac
authored
May 05, 2020
by
thanhnd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
history_jobs doing
parent
f302f7cb
Pipeline
#600
failed with stages
in 0 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
1 deletions
+23
-1
app/controllers/jobs_controller.rb
+1
-0
app/models/history_job.rb
+5
-0
db/migrate/20200505042407_create_history_jobs.rb
+9
-0
db/schema.rb
+8
-1
No files found.
app/controllers/jobs_controller.rb
View file @
0ebcc9ac
class
JobsController
<
ApplicationController
def
show
@job_detail
=
Job
.
find_by_id
(
params
[
:id
])
HistoryJob
.
find_or_create_by
(
job_id:
@job_detail
.
id
,
user_id:
current_user
)
end
def
index
...
...
app/models/history_job.rb
0 → 100644
View file @
0ebcc9ac
class
HistoryJob
<
ApplicationRecord
belongs_to
:job
belongs_to
:user
end
\ No newline at end of file
db/migrate/20200505042407_create_history_jobs.rb
0 → 100644
View file @
0ebcc9ac
class
CreateHistoryJobs
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:history_jobs
do
|
t
|
t
.
integer
:user_id
t
.
integer
:job_id
t
.
timestamps
end
end
end
db/schema.rb
View file @
0ebcc9ac
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_0
3_09_014715
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_0
5_05_042407
)
do
create_table
"applied_jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
integer
"user_id"
...
...
@@ -48,6 +48,13 @@ ActiveRecord::Schema.define(version: 2020_03_09_014715) do
t
.
index
[
"email"
],
name:
"index_companies_on_email"
end
create_table
"history_jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
integer
"user_id"
t
.
integer
"job_id"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
end
create_table
"industries"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
text
"industry_name"
t
.
string
"industry_description"
...
...
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