Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_nth
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
Ngô Trung Hưng
venjob_nth
Commits
56cba0ab
You need to sign in or sign up before continuing.
Commit
56cba0ab
authored
Jul 29, 2020
by
Ngô Trung Hưng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
4a5093e8
Pipeline
#737
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/models/city.rb
+1
-0
lib/service/import_data.rb
+1
-2
No files found.
app/models/city.rb
View file @
56cba0ab
...
...
@@ -4,4 +4,5 @@
class
City
<
ApplicationRecord
has_many
:city_jobs
has_many
:jobs
,
through: :city_jobs
enum
area:
{
international:
0
,
domestic
:
1
}
end
lib/service/import_data.rb
View file @
56cba0ab
...
...
@@ -4,7 +4,6 @@ require 'service/ftp'
# Import data from CSV
class
ImportData
DOMESTIC
=
1
COMPANY_SECURITY
=
1
def
import_data
...
...
@@ -39,7 +38,7 @@ class ImportData
cities
.
each
do
|
val
|
next
if
val
.
blank?
City
.
find_or_create_by
(
name:
val
)
{
|
city
|
city
.
area
=
DOMESTIC
}
City
.
find_or_create_by
(
name:
val
,
area:
City
.
areas
[
'domestic'
])
end
rescue
StandardError
=>
e
logger
.
error
"Import_cities:
#{
e
}
"
...
...
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