Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
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
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Nguyen Ngoc Nghia
  • VeNJOB
  • Merge Requests
  • !6

Merged
Opened Dec 03, 2019 by Nguyen Ngoc Nghia@nghiann 
  • Report abuse
Report abuse

Feature/import data

×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b feature/import_data origin/feature/import_data

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff feature/import_data

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 28
  • Commits 31
  • Changes 73
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • bb73edf4 - delete 1 file

    Compare with previous version

    Dec 03, 2019

    added 1 commit

    • bb73edf4 - delete 1 file

    Compare with previous version

    added 1 commit * bb73edf4 - delete 1 file [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4412&start_sha=9ec44ff755fa862f6a04a31363b4d31e1f8131c9)
    Toggle commit list
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 04, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    db/migrate/20191202023440_add_index_to_company_code.rb 0 → 100644
    1 class AddIndexToCompanyCode < ActiveRecord::Migration[6.0]
    2 def change
    3 add_index :companies, :company_code, unique: true
    • Son Do Hong @sondh commented Dec 04, 2019
      Master

      viết cùng file migration với add company_code

      viết cùng file migration với add company_code
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 4 of the diff

      Dec 05, 2019

      changed this line in version 4 of the diff

      changed this line in [version 4 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4414&start_sha=fa48d1c35312b9b8c7738e11767b650873fc4b73#34734c1a98b602fffdccbc7be7dc55b68e4e9198_3_0)
      Toggle commit list
    Please register or sign in to reply
  • Nguyen Ngoc Nghia @nghiann

    added 2 commits

    • 6c1516cb - using rake task
    • fa48d1c3 - edit routes.rb

    Compare with previous version

    Dec 05, 2019

    added 2 commits

    • 6c1516cb - using rake task
    • fa48d1c3 - edit routes.rb

    Compare with previous version

    added 2 commits * 6c1516cb - using rake task * fa48d1c3 - edit routes.rb [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4413&start_sha=bb73edf41586b5278770343f0228ed9029dcf169)
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    resolved all discussions

    Dec 05, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • 19ec4b1a - edit migration file

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • 19ec4b1a - edit migration file

    Compare with previous version

    added 1 commit * 19ec4b1a - edit migration file [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4414&start_sha=fa48d1c35312b9b8c7738e11767b650873fc4b73)
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • bfd51eae - edit company_code migration

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • bfd51eae - edit company_code migration

    Compare with previous version

    added 1 commit * bfd51eae - edit company_code migration [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4415&start_sha=19ec4b1a4c473c8b892208171f673536de747156)
    Toggle commit list
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/services/cities.rb 0 → 100644
    1 require "csv"
    2 require "activerecord-import"
    3 # require "activerecord -import/active_record/adapters/mysql_adapter"
    • Van Hau Le @haulv commented Dec 05, 2019
      Master

      Move hết vào folder import trong services, tạo class base (Import::Base). Rồi những logic chung của phần import mình sẽ để hết ở đây, những phần import riêng lẻ chỉ việc kế thừa thằng base thôi nhé!

      Move hết vào folder import trong services, tạo class base (Import::Base). Rồi những logic chung của phần import mình sẽ để hết ở đây, những phần import riêng lẻ chỉ việc kế thừa thằng base thôi nhé!
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 6 of the diff

      Dec 05, 2019

      changed this line in version 6 of the diff

      changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4416&start_sha=bfd51eaeff95d10b73fdebeb04a9b2c9e04a1c5e#f2414965a99d3ad797e2f1df3545f78c940c3e08_3_0)
      Toggle commit list
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/services/companies.rb 0 → 100644
    1 require "csv"
    2 require "activerecord-import"
    3 # require "activerecord -import/active_record/adapters/mysql_adapter"
    • Van Hau Le @haulv commented Dec 05, 2019
      Master

      tương tự comment trên

      tương tự comment trên
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 6 of the diff

      Dec 05, 2019

      changed this line in version 6 of the diff

      changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4416&start_sha=bfd51eaeff95d10b73fdebeb04a9b2c9e04a1c5e#488f2230b0c2663f33306c71a0a6ef3519eb7f21_3_0)
      Toggle commit list
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/services/companies.rb 0 → 100644
    1 require "csv"
    2 require "activerecord-import"
    3 # require "activerecord -import/active_record/adapters/mysql_adapter"
    4
    5 class CompanyImport
    6 def companies
    • Van Hau Le @haulv commented Dec 05, 2019
      Master

      Nên đổi tên method thành import (hoặc excute/perform/call ...).

      Nên đổi tên method thành import (hoặc excute/perform/call ...).
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 6 of the diff

      Dec 05, 2019

      changed this line in version 6 of the diff

      changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4416&start_sha=bfd51eaeff95d10b73fdebeb04a9b2c9e04a1c5e#488f2230b0c2663f33306c71a0a6ef3519eb7f21_6_0)
      Toggle commit list
    Please register or sign in to reply
  • Nguyen Ngoc Nghia @nghiann

    resolved all discussions

    Dec 05, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • e47f536f - using 1 import file

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • e47f536f - using 1 import file

    Compare with previous version

    added 1 commit * e47f536f - using 1 import file [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4416&start_sha=bfd51eaeff95d10b73fdebeb04a9b2c9e04a1c5e)
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • 5704377f - delete helpers file

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • 5704377f - delete helpers file

    Compare with previous version

    added 1 commit * 5704377f - delete helpers file [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4417&start_sha=e47f536f8f37e06b307cebea1cbaf341ec1d2534)
    Toggle commit list
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    config/routes.rb
    1 1 Rails.application.routes.draw do
    2 get "companies/index"
    3 get "industries/index"
    4 get "cities/index"
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      dùng resource

      dùng resource
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 8 of the diff

      Dec 05, 2019

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4418&start_sha=5704377f372b9ddeb38f315085e4c949c7fac47c#e801163eb9182955dca3eb9817d59af634f6665d_4_2)
      Toggle commit list
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/services/import.rb 0 → 100644
    11
    12 city_columns = [:name, :region]
    13 company_columns = [:name, :email, :address, :code]
    14 industry_columns = [:name]
    15 job_columns = [:title, :level, :salary, :description, :short_des, :requirement,
    16 :category, :company_id]
    17
    18 CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
    19 cities << {name: row["company province"], region: "Việt Nam"}
    20 companies << {name: row["company name"], email: row["contact email"],
    21 address: row["company address"], code: row["company id"]}
    22 industries << {name: row["category"]}
    23 jobs << {title: row["name"], level: row["level"], salary: row["salary"],
    24 description: row["description"], short_des: row["benefit"],
    25 requirement: row["requirement"], category: row["type"],
    26 company_id: Company.find_by(code: row["company id"])&.id}
    • Van Hau Le @haulv commented Dec 05, 2019
      Master

      @nghiann với những company chưa có trong DB thì id trả về sẽ null nhé em! Lúc đó cả cái job sẽ bị ignore luôn! EM check lại logic chỗ này nhé!

      @nghiann với những company chưa có trong DB thì id trả về sẽ null nhé em! Lúc đó cả cái job sẽ bị ignore luôn! EM check lại logic chỗ này nhé!
    • Nguyen Ngoc Nghia @nghiann commented Dec 05, 2019
      Master

      dạ oke a

      dạ oke a
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 9 of the diff

      Dec 05, 2019

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4420&start_sha=36ffa23a42420706760c74f122bfd53fc1f22c2e#181c0609d0445eabc5f837576dceeaa9280eb112_24_18)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    lib/tasks/task.rake 0 → 100644
    1 require "./app/services/import.rb"
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      require ở đây có ý nghĩa là gì

      require ở đây có ý nghĩa là gì
    • Nguyen Ngoc Nghia @nghiann commented Dec 05, 2019
      Master

      ban đầu e nghĩ nên require để có task sử dụng đúng file nhưng bỏ đi vẫn chạy được

      ban đầu e nghĩ nên require để có task sử dụng đúng file nhưng bỏ đi vẫn chạy được
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 8 of the diff

      Dec 05, 2019

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4418&start_sha=5704377f372b9ddeb38f315085e4c949c7fac47c#8bdc06fb3570cc496d75ff451b8ff0608e99ac12_1_1)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/services/import.rb 0 → 100644
    1 require "csv"
    2 require "activerecord-import"
    3 # require "activerecord -import/active_record/adapters/mysql_adapter"
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      xóa comment

      xóa comment
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 8 of the diff

      Dec 05, 2019

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4418&start_sha=5704377f372b9ddeb38f315085e4c949c7fac47c#181c0609d0445eabc5f837576dceeaa9280eb112_3_2)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/services/import.rb 0 → 100644
    1 require "csv"
    2 require "activerecord-import"
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      có cần thiết phải require không

      có cần thiết phải require không
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 8 of the diff

      Dec 05, 2019

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4418&start_sha=5704377f372b9ddeb38f315085e4c949c7fac47c#181c0609d0445eabc5f837576dceeaa9280eb112_2_2)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on the diff Dec 05, 2019
    Resolved by Son Do Hong Dec 05, 2019
    app/services/import.rb 0 → 100644
    15 job_columns = [:title, :level, :salary, :description, :short_des, :requirement,
    16 :category, :company_id]
    17
    18 CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
    19 cities << {name: row["company province"], region: "Việt Nam"}
    20 companies << {name: row["company name"], email: row["contact email"],
    21 address: row["company address"], code: row["company id"]}
    22 industries << {name: row["category"]}
    23 jobs << {title: row["name"], level: row["level"], salary: row["salary"],
    24 description: row["description"], short_des: row["benefit"],
    25 requirement: row["requirement"], category: row["type"],
    26 company_id: Company.find_by(code: row["company id"])&.id}
    27 end
    28
    29 City.import city_columns, cities, on_duplicate_key_ignore: true
    30 Company.import company_columns, companies, on_duplicate_key_ignore: true
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      nên thêm message sau mỗi dòng import Ví dụ:

      puts 100 cities imported

      thay vì việc mình chạy rake task và chờ nó chạy xong. Nó sẽ hiện lên:

      • cities imported
      • Company imported
      • job imported ...
      Edited Dec 05, 2019 by Son Do Hong
      nên thêm message sau mỗi dòng import Ví dụ: `puts 100 cities imported` thay vì việc mình chạy rake task và chờ nó chạy xong. Nó sẽ hiện lên: * cities imported * Company imported * job imported ...
    • Nguyen Ngoc Nghia @nghiann commented Dec 05, 2019
      Master

      chỗ này e thêm code vào rồi sao nó ko resolve ta

      chỗ này e thêm code vào rồi sao nó ko resolve ta
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      vì nó k đúng dòng =))

      vì nó k đúng dòng =))
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/services/import.rb 0 → 100644
    17
    18 CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
    19 cities << {name: row["company province"], region: "Việt Nam"}
    20 companies << {name: row["company name"], email: row["contact email"],
    21 address: row["company address"], code: row["company id"]}
    22 industries << {name: row["category"]}
    23 jobs << {title: row["name"], level: row["level"], salary: row["salary"],
    24 description: row["description"], short_des: row["benefit"],
    25 requirement: row["requirement"], category: row["type"],
    26 company_id: Company.find_by(code: row["company id"])&.id}
    27 end
    28
    29 City.import city_columns, cities, on_duplicate_key_ignore: true
    30 Company.import company_columns, companies, on_duplicate_key_ignore: true
    31 Industry.import industry_columns, industries, on_duplicate_key_ignore: true
    32 Job.import job_columns, jobs
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      nếu chạy rake import 2 lần cùng 1 file csv thì lần sau sẽ update dữ liệu hay tạo mới dữ liệu?

      nếu chạy rake import 2 lần cùng 1 file csv thì lần sau sẽ update dữ liệu hay tạo mới dữ liệu?
    • Nguyen Ngoc Nghia @nghiann commented Dec 05, 2019
      Master

      hiện tại vẫn sẽ chỉ tạo mới dữ liệu, e chưa viết hàm để update

      hiện tại vẫn sẽ chỉ tạo mới dữ liệu, e chưa viết hàm để update
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      @nghiann tìm cách xử lí luôn cái đó đi xem

      @nghiann tìm cách xử lí luôn cái đó đi xem
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 9 of the diff

      Dec 05, 2019

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4420&start_sha=36ffa23a42420706760c74f122bfd53fc1f22c2e#181c0609d0445eabc5f837576dceeaa9280eb112_36_28)
      Toggle commit list
    Please register or sign in to reply
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • 36ffa23a - edit task.rake file

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • 36ffa23a - edit task.rake file

    Compare with previous version

    added 1 commit * 36ffa23a - edit task.rake file [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4418&start_sha=5704377f372b9ddeb38f315085e4c949c7fac47c)
    Toggle commit list
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    config/routes.rb
    1 1 Rails.application.routes.draw do
    2 resources :companies
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      giới hạn các action lại, dùng action nào thì khai báo action đó

      giới hạn các action lại, dùng action nào thì khai báo action đó
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 10 of the diff

      Dec 05, 2019

      changed this line in version 10 of the diff

      changed this line in [version 10 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4421&start_sha=e2e10771ef398760ca095a958486e0624029f4d8#e801163eb9182955dca3eb9817d59af634f6665d_2_2)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    lib/tasks/task.rake 0 → 100644
    1 # require "./app/services/import.rb"
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      tránh comment code, không sử dụng thì xóa đi

      tránh comment code, không sử dụng thì xóa đi
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 9 of the diff

      Dec 05, 2019

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4420&start_sha=36ffa23a42420706760c74f122bfd53fc1f22c2e#8bdc06fb3570cc496d75ff451b8ff0608e99ac12_1_1)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/views/jobs/index.html.erb 0 → 100644
    1 <table class="table">
    2 <thead>
    3 <tr>
    4 <th scope="col">title</th>
    5 <th scope="col">short description</th>
    6 <th scope="col">salary</th>
    7 </tr>
    8 </thead>
    9 <tbody>
    10 <% @jobs.each do |job| %>
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      chỗ này viết partial rồi mà sao ko render kiểu collection nhỉ

      chỗ này viết partial rồi mà sao ko render kiểu collection nhỉ
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 9 of the diff

      Dec 05, 2019

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4420&start_sha=36ffa23a42420706760c74f122bfd53fc1f22c2e#fd4909543e4d41ae0af907baf233a50d8e08d125_10_1)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/views/cities/index.html.erb 0 → 100644
    1 <table class="table">
    2 <thead>
    3 <tr>
    4 <th scope="col">name</th>
    5 <th scope="col">region</th>
    6 </tr>
    7 </thead>
    8 <tbody>
    9 <% @cities.each do |city| %>
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      render kiểu partial đi cho đẹp

      render kiểu partial đi cho đẹp
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 9 of the diff

      Dec 05, 2019

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4420&start_sha=36ffa23a42420706760c74f122bfd53fc1f22c2e#72745993370f54722877a5d8c7c16981ee972277_9_1)
      Toggle commit list
    Please register or sign in to reply
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • e2e10771 - split job import file

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • e2e10771 - split job import file

    Compare with previous version

    added 1 commit * e2e10771 - split job import file [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4420&start_sha=36ffa23a42420706760c74f122bfd53fc1f22c2e)
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    resolved all discussions

    Dec 05, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • 650fe20d - edit routes.rb

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • 650fe20d - edit routes.rb

    Compare with previous version

    added 1 commit * 650fe20d - edit routes.rb [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4421&start_sha=e2e10771ef398760ca095a958486e0624029f4d8)
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    resolved all discussions

    Dec 05, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • baa590fd - fix row name in job_csv.rb

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • baa590fd - fix row name in job_csv.rb

    Compare with previous version

    added 1 commit * baa590fd - fix row name in job_csv.rb [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4422&start_sha=650fe20dbc314f6d17f1316b044cdb25b25b7187)
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    resolved all discussions

    Dec 05, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • 9fdd6793 - add code to jobs

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • 9fdd6793 - add code to jobs

    Compare with previous version

    added 1 commit * 9fdd6793 - add code to jobs [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4423&start_sha=baa590fddf71a9953998215f58961e3955b9449b)
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    resolved all discussions

    Dec 05, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • c78f604d - update

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • c78f604d - update

    Compare with previous version

    added 1 commit * c78f604d - update [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4424&start_sha=9fdd67939a9aebea72f372e4184aa7e46a3f85a7)
    Toggle commit list
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/services/job_csv.rb 0 → 100644
    24 end
    25
    26 def requirement
    27 @requirement ||= @row["requirement"]
    28 end
    29
    30 def category
    31 @category ||= @row["type"]
    32 end
    33
    34 def company_id
    35 @company_id ||= company.id
    36 end
    37
    38 def company
    39 @company ||= Company.find_or_create_by(code: @row["company id"])
    • Van Hau Le @haulv commented Dec 05, 2019
      Master

      @nghiann chỗ nãy a có nói là đưa mấy cái attributes vào nhé e! Mỗi company code là không đủ để create company

      @nghiann chỗ nãy a có nói là đưa mấy cái attributes vào nhé e! Mỗi company code là không đủ để create company
    • Nguyen Ngoc Nghia @nghiann commented Dec 05, 2019
      Master

      @haulv e quên mất để e edit

      @haulv e quên mất để e edit
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 14 of the diff

      Dec 05, 2019

      changed this line in version 14 of the diff

      changed this line in [version 14 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4425&start_sha=c78f604d428615f84f74ee91f8524cc1e354de14#521b211e333ad796161bdcad7265364a622e0d65_39_39)
      Toggle commit list
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 06, 2019
    app/services/jobs_import.rb 0 → 100644
    1 require "csv"
    2
    3 class JobsImport
    4 def import_job
    5 jobs = []
    6 job_columns = [:title, :level, :salary, :description, :short_des,
    7 :requirement, :category, :company_id]
    8
    9 CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
    10 jobcsv = JobCsv.new(row)
    11 jobs << jobcsv.csv_attributes
    • Van Hau Le @haulv commented Dec 05, 2019
      Master

      @nghiann nếu chỉ call mỗi csv_attributes thì có thể viết gọn

      jobs << JobCsv.new(row).csv_attributes
      
      @nghiann nếu chỉ call mỗi csv_attributes thì có thể viết gọn ``` jobs << JobCsv.new(row).csv_attributes ```
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 15 of the diff

      Dec 06, 2019

      changed this line in version 15 of the diff

      changed this line in [version 15 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4426&start_sha=8b301c0d0104df58ca8660273ace8cf67b157c0a#1f65720902ca3865605cceae7968bb28d7cbe838_11_10)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 05, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 05, 2019
    app/services/job_csv.rb 0 → 100644
    28 end
    29
    30 def category
    31 @category ||= @row["type"]
    32 end
    33
    34 def company_id
    35 @company_id ||= company.id
    36 end
    37
    38 def company
    39 @company ||= Company.find_or_create_by(code: @row["company id"])
    40 end
    41
    42 def csv_attributes
    43 {title: self.title, level: self.level, salary: self.salary, description: self.description,
    • Son Do Hong @sondh commented Dec 05, 2019
      Master

      không cần dùng self ở đây

      không cần dùng self ở đây
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 14 of the diff

      Dec 05, 2019

      changed this line in version 14 of the diff

      changed this line in [version 14 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4425&start_sha=c78f604d428615f84f74ee91f8524cc1e354de14#521b211e333ad796161bdcad7265364a622e0d65_43_46)
      Toggle commit list
    Please register or sign in to reply
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • 8b301c0d - edit job_csv.rb file

    Compare with previous version

    Dec 05, 2019

    added 1 commit

    • 8b301c0d - edit job_csv.rb file

    Compare with previous version

    added 1 commit * 8b301c0d - edit job_csv.rb file [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4425&start_sha=c78f604d428615f84f74ee91f8524cc1e354de14)
    Toggle commit list
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 06, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 06, 2019
    app/controllers/static_pages_controller.rb
    1 1 class StaticPagesController < ApplicationController
    2 2 def index
    3 @cities = City.all
    4 @industries = Industry.all
    5 @jobs = Job.page(params[:page]).per(5)
    • Son Do Hong @sondh commented Dec 06, 2019
      Master

      https://tech.zigexn.vn/magic-number-and-handling-in-rails/ @nghiann cho số 5 vào trong setting nhé

      https://tech.zigexn.vn/magic-number-and-handling-in-rails/ @nghiann cho số 5 vào trong setting nhé
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 15 of the diff

      Dec 06, 2019

      changed this line in version 15 of the diff

      changed this line in [version 15 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4426&start_sha=8b301c0d0104df58ca8660273ace8cf67b157c0a#e411ad7eefd53bf4aa08f4a552ee9cbdb8f5a0f2_5_5)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 06, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 06, 2019
    app/views/companies/index.html.erb 0 → 100644
    1 <table class="table">
    2 <thead>
    3 <tr>
    4 <th scope="col">company name</th>
    5 <th scope="col">contact email</th>
    6 <th scope="col">company address</th>
    7 <th scope="col">company code</th>
    8 </tr>
    9 </thead>
    10 <tbody>
    11 <% @companies.each do |company| %>
    • Son Do Hong @sondh commented Dec 06, 2019
      Master

      đây cũng dùng partial luôn đi chứ

      đây cũng dùng partial luôn đi chứ
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 15 of the diff

      Dec 06, 2019

      changed this line in version 15 of the diff

      changed this line in [version 15 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4426&start_sha=8b301c0d0104df58ca8660273ace8cf67b157c0a#6d1a23579d496eb8c8d46f507ff3c71c298ec3bf_11_3)
      Toggle commit list
    Please register or sign in to reply
  • Son Do Hong
    @sondh started a discussion on an old version of the diff Dec 06, 2019
    Automatically resolved by Nguyen Ngoc Nghia with a push Dec 06, 2019
    app/models/job.rb
    1 # In database
    2 # t.string :title
    3 # t.string :level
    4 # t.string :salary
    5 # t.string :other_salary
    6 # t.text :description
    7 # t.text :short_des
    • Son Do Hong @sondh commented Dec 06, 2019
      Master

      cái comment này em đang làm bằng gì nhỉ? thử cái gem này xem sao https://github.com/ctran/annotate_models

      cái comment này em đang làm bằng gì nhỉ? thử cái gem này xem sao https://github.com/ctran/annotate_models
    • Nguyen Ngoc Nghia @nghiann

      changed this line in version 16 of the diff

      Dec 06, 2019

      changed this line in version 16 of the diff

      changed this line in [version 16 of the diff](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4427&start_sha=aa3d07a6ce2c449350c90cefae85cb4543cd5ed0#742abd5cbc2b12d2da315862ace6297c7d6dcb87_37_31)
      Toggle commit list
    Please register or sign in to reply
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • aa3d07a6 - using gem config and annotate

    Compare with previous version

    Dec 06, 2019

    added 1 commit

    • aa3d07a6 - using gem config and annotate

    Compare with previous version

    added 1 commit * aa3d07a6 - using gem config and annotate [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4426&start_sha=8b301c0d0104df58ca8660273ace8cf67b157c0a)
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    resolved all discussions

    Dec 06, 2019

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Nguyen Ngoc Nghia @nghiann

    added 1 commit

    • 0f5b554b - edit model files

    Compare with previous version

    Dec 06, 2019

    added 1 commit

    • 0f5b554b - edit model files

    Compare with previous version

    added 1 commit * 0f5b554b - edit model files [Compare with previous version](https://gitlab.zigexn.vn/nghiann/VeNJOB/merge_requests/6/diffs?diff_id=4427&start_sha=aa3d07a6ce2c449350c90cefae85cb4543cd5ed0)
    Toggle commit list
  • Son Do Hong @sondh

    mentioned in commit f7eb9e0f

    Dec 06, 2019

    mentioned in commit f7eb9e0f

    mentioned in commit f7eb9e0f286ff60d0d34887edd92fad3c115d0f9
    Toggle commit list
  • Son Do Hong @sondh

    merged

    Dec 06, 2019

    merged

    merged
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Nguyen Ngoc Nghia
Assignee
Nguyen Ngoc Nghia @nghiann
Assign to
None
Milestone
None
Assign milestone
Time tracking
3
3 participants
Reference: nghiann/VeNJOB!6
×

Revert this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.