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
1
Merge Requests
1
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
Tô Ngọc Ánh
VeNJob
Commits
b1b847f2
Commit
b1b847f2
authored
Aug 07, 2020
by
Tô Ngọc Ánh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix syntax rubocop
parent
d06a8465
Pipeline
#840
canceled with stages
in 0 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
app/controllers/jobs_controller.rb
+0
-0
app/models/company.rb
+1
-1
app/models/industry.rb
+1
-1
app/models/location.rb
+1
-1
lib/tasks/create_slug.rake
+3
-3
No files found.
app/controllers/jobs_controller.rb
View file @
b1b847f2
app/models/company.rb
View file @
b1b847f2
...
...
@@ -10,6 +10,6 @@ class Company < ApplicationRecord
private
def
add_slug
self
.
slug
=
"
#{
self
.
to_slug
(
self
.
name
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10
000
)
}
"
self
.
slug
=
"
#{
to_slug
(
name
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10_
000
)
}
"
end
end
app/models/industry.rb
View file @
b1b847f2
...
...
@@ -13,6 +13,6 @@ class Industry < ApplicationRecord
private
def
add_slug
self
.
slug
=
"
#{
self
.
to_slug
(
self
.
name
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10
000
)
}
"
self
.
slug
=
"
#{
to_slug
(
name
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10_
000
)
}
"
end
end
app/models/location.rb
View file @
b1b847f2
...
...
@@ -18,6 +18,6 @@ class Location < ApplicationRecord
private
def
add_slug
self
.
slug
=
"
#{
self
.
to_slug
(
self
.
city
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10
000
)
}
"
self
.
slug
=
"
#{
to_slug
(
city
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10_
000
)
}
"
end
end
lib/tasks/create_slug.rake
View file @
b1b847f2
...
...
@@ -2,21 +2,21 @@ namespace :create_slug do
desc
'Create slug model Location'
task
locations: :environment
do
Location
.
all
.
each
do
|
location
|
location
.
update_attributes
(
slug:
"
#{
location
.
to_slug
(
location
.
city
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10000
)
}
"
)
location
.
update_attributes
(
slug:
"
#{
location
.
to_slug
(
location
.
city
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10
_
000
)
}
"
)
end
end
desc
'Create slug model Industry'
task
industries: :environment
do
Industry
.
all
.
each
do
|
industry
|
industry
.
update_attributes
(
slug:
"
#{
industry
.
to_slug
(
industry
.
name
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10000
)
}
"
)
industry
.
update_attributes
(
slug:
"
#{
industry
.
to_slug
(
industry
.
name
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10
_
000
)
}
"
)
end
end
desc
'Create slug model Company'
task
companies: :environment
do
Company
.
all
.
each
do
|
company
|
company
.
update_attributes
(
slug:
"
#{
company
.
to_slug
(
company
.
name
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10000
)
}
"
)
company
.
update_attributes
(
slug:
"
#{
company
.
to_slug
(
company
.
name
)
}
-
#{
Time
.
now
.
to_i
}#{
rand
(
10
_
000
)
}
"
)
end
end
...
...
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