Skip to content

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

Merged
Opened Mar 05, 2020 by thanhnd@thanhnd 
  • Report abuse
Report abuse

City list

  • Discussion 12
  • Commits 9
  • Pipelines 9
  • Changes 9
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Mar 09, 2020
    Last updated by thanhnd Mar 12, 2020
    test/controllers/industries_controller_test.rb 0 → 100644
    1 require 'test_helper'
    • Ba Toi Dang @toidb commented Mar 09, 2020
      Master

      @thanhnd xóa file dư.

      @thanhnd xóa file dư.
    • thanhnd @thanhnd

      changed this line in version 2 of the diff

      Mar 12, 2020

      changed this line in version 2 of the diff

      changed this line in [version 2 of the diff](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4741&start_sha=2d57efded7a0785ce65b5064ee2c9f79c3f60e13#1d4e995e8b825a78514908d10d6964efa07f8a34_1_0)
      Toggle commit list
    Please register or sign in to reply
  • thanhnd @thanhnd

    added 1 commit

    • 009e0198 - fix review 20200312 1

    Compare with previous version

    Mar 12, 2020

    added 1 commit

    • 009e0198 - fix review 20200312 1

    Compare with previous version

    added 1 commit * 009e0198 - fix review 20200312 1 [Compare with previous version](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4741&start_sha=2d57efded7a0785ce65b5064ee2c9f79c3f60e13)
    Toggle commit list
  • thanhnd @thanhnd

    added 12 commits

    • 009e0198...b36f3848 - 11 commits from branch master
    • 167fb2c0 - Merged master

    Compare with previous version

    Mar 13, 2020

    added 12 commits

    • 009e0198...b36f3848 - 11 commits from branch master
    • 167fb2c0 - Merged master

    Compare with previous version

    added 12 commits * 009e0198...b36f3848 - 11 commits from branch `master` * 167fb2c0 - Merged master [Compare with previous version](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4750&start_sha=009e01980ac74f4b898769bff55593d55a6b186d)
    Toggle commit list
  • thanhnd @thanhnd

    added 1 commit

    • cc8a60f1 - delete test file

    Compare with previous version

    Mar 13, 2020

    added 1 commit

    • cc8a60f1 - delete test file

    Compare with previous version

    added 1 commit * cc8a60f1 - delete test file [Compare with previous version](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4751&start_sha=167fb2c090b697d56bdb5c899519804bdb4ed1c8)
    Toggle commit list
  • thanhnd @thanhnd

    added 1 commit

    • b61c3320 - scope to class method

    Compare with previous version

    Apr 06, 2020

    added 1 commit

    • b61c3320 - scope to class method

    Compare with previous version

    added 1 commit * b61c3320 - scope to class method [Compare with previous version](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4767&start_sha=cc8a60f1f92ddb6b7a028115954f22ca6991676c)
    Toggle commit list
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Apr 07, 2020
    Last updated by thanhnd Apr 07, 2020
    app/models/industry.rb
    3 3 has_many :jobs
    4 4 validates_presence_of :industry_name
    5 5 scope :top_industry_by_job, ->{joins(:jobs).select('industries.*, COUNT(jobs.id) as job_count').group('jobs.industry_id').order(:job_count).last(9)}
    6 scope :all_industry_by_job, ->{joins(:jobs).select('industries.*, COUNT(jobs.id) as job_count').group('jobs.industry_id').order(:job_count).reverse_order}
    • Thanh Hung Pham @hungpt commented Apr 07, 2020

      @thanhnd change to Class method too.

      @thanhnd change to Class method too.
    • thanhnd @thanhnd

      changed this line in version 7 of the diff

      Apr 07, 2020

      changed this line in version 7 of the diff

      changed this line in [version 7 of the diff](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4768&start_sha=b61c33205210ff42de945ce6339832d968bcec5e#6fd7ec4bda80a3376d591b3e766bce8bf035c4c6_6_5)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Apr 07, 2020
    Last updated by thanhnd Apr 07, 2020
    app/views/cities/index.html.erb 0 → 100644
    2 <div id="search" class="container p-5 my-2 bg-secondary text-white">
    3 <%= form_tag job_search_path, method: :get do %>
    4 <p>
    5 <%= text_field_tag :search, params[:search] %>
    6 <%= button_tag "Search", name: nil %>
    7 </p>
    8 <% end %>
    9 </div>
    10
    11 <div id="city_list"class="container p-5 my-2 bg-secondary text-white">
    12 <font color="red"><b><label > City List:</label></b></font>
    13 <br>
    14 <label><a href="#topcity_vn">Viet Nam</a></label>
    15 <br>
    16 <label><a href="#topcity_nn">International</a></label>
    17
    • Thanh Hung Pham @hungpt commented Apr 07, 2020

      @thanhnd Remove all empty lines in the file and another file if have.

      @thanhnd Remove all empty lines in the file and another file if have.
    • thanhnd @thanhnd

      changed this line in version 7 of the diff

      Apr 07, 2020

      changed this line in version 7 of the diff

      changed this line in [version 7 of the diff](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4768&start_sha=b61c33205210ff42de945ce6339832d968bcec5e#72745993370f54722877a5d8c7c16981ee972277_17_17)
      Toggle commit list
    Please register or sign in to reply
  • Thanh Hung Pham
    @hungpt started a discussion on an old version of the diff Apr 07, 2020
    Last updated by thanhnd Apr 07, 2020
    app/views/cities/index.html.erb 0 → 100644
    9 </div>
    10
    11 <div id="city_list"class="container p-5 my-2 bg-secondary text-white">
    12 <font color="red"><b><label > City List:</label></b></font>
    13 <br>
    14 <label><a href="#topcity_vn">Viet Nam</a></label>
    15 <br>
    16 <label><a href="#topcity_nn">International</a></label>
    17
    18
    19
    20 </div>
    21
    22 <div id="topcity_vn" class="container p-5 my-2 bg-secondary text-white">
    23 <font color="red"><b><label > Viet Nam:</label></b></font>
    24 <% @all_cities_vn.each do |city_vn| %>
    • Thanh Hung Pham @hungpt commented Apr 07, 2020

      @thanhnd Here we display top cities, why using @all_cities_vn here?

      @thanhnd Here we display `top cities`, why using `@all_cities_vn` here?
    • thanhnd @thanhnd

      changed this line in version 7 of the diff

      Apr 07, 2020

      changed this line in version 7 of the diff

      changed this line in [version 7 of the diff](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4768&start_sha=b61c33205210ff42de945ce6339832d968bcec5e#72745993370f54722877a5d8c7c16981ee972277_24_21)
      Toggle commit list
    Please register or sign in to reply
  • Hiếu Lê @hieulh commented Apr 07, 2020

    Naming convention

    Có 1 lỗi chung đang sai nhiều chỗ đó là cách đặt tên biến. Nếu dữ liệu trả về array, hash,...nói chung là số nhiều thì biến phải là số nhiều để đọc tên biến là biết nó chứa cái gì luôn. VD:

        @top_cities_vn = City.top_city_by_job
        @top_cities_nn = City.top_city_by_job_nn
        @all_cities_vn = City.all_city_by_job
        @all_cities_nn = City.all_city_by_job_nn
    

    Nên đặt là:

        @top_cities_vn = City.top_cities_by_job
        @top_cities_nn = City.top_cities_by_job_nn
        @all_cities_vn = City.all_cities_by_job
        @all_cities_nn = City.all_cities_by_job_nn
    
    @all_industry = Industry.all_industry_by_job

    Nên là

    @all_industries = Industry.all_industries_by_job
    Edited Apr 07, 2020 by Hiếu Lê
    ### Naming convention Có 1 lỗi chung đang sai nhiều chỗ đó là cách đặt tên biến. Nếu dữ liệu trả về array, hash,...nói chung là số nhiều thì biến phải là số nhiều để đọc tên biến là biết nó chứa cái gì luôn. VD: ``` @top_cities_vn = City.top_city_by_job @top_cities_nn = City.top_city_by_job_nn @all_cities_vn = City.all_city_by_job @all_cities_nn = City.all_city_by_job_nn ``` Nên đặt là: ``` @top_cities_vn = City.top_cities_by_job @top_cities_nn = City.top_cities_by_job_nn @all_cities_vn = City.all_cities_by_job @all_cities_nn = City.all_cities_by_job_nn ``` ``` @all_industry = Industry.all_industry_by_job ``` Nên là ``` @all_industries = Industry.all_industries_by_job ```
  • Hiếu Lê @hieulh commented Apr 07, 2020

    Cách đặt tên field trong từng table.

    Trong bảng companies có các field company_name, company_description. Tên khá dài dòng lúc gọi ra cũng dài luôn.

    Ví dụ: company.company_name -> Chữ company gọi 2 lần.

    Thực ra tên field chỉ cần là name, description là đủ.

    Ví dụ: company.name -> Ai cũng hiểu là lấy name của company

    Tương tự cho các table khác cũng bị tương tự.

    Edited Apr 07, 2020 by Hiếu Lê
    ### Cách đặt tên field trong từng table. Trong bảng `companies` có các field `company_name`, `company_description`. Tên khá dài dòng lúc gọi ra cũng dài luôn. Ví dụ: `company.company_name` -> Chữ company gọi 2 lần. Thực ra tên field chỉ cần là `name`, `description` là đủ. Ví dụ: `company.name` -> Ai cũng hiểu là lấy `name` của `company` Tương tự cho các table khác cũng bị tương tự.
  • Hiếu Lê @hieulh commented Apr 07, 2020

    Rails routing

    Cách dùng route tạm thời ok nhưng nếu sau này có các tranh detail cho city, industry này nọ thì nó sẽ ko đẹp nữa. Nên dùng resource or resources nếu có thể.

    Ví dụ:

    get 'cities', to: 'cities#index'

    Chuyển thành:

    resources :cities, only: [:index]
    Edited Apr 07, 2020 by Hiếu Lê
    ### Rails routing Cách dùng route tạm thời ok nhưng nếu sau này có các tranh detail cho city, industry này nọ thì nó sẽ ko đẹp nữa. Nên dùng resource or resources nếu có thể. Ví dụ: ``` get 'cities', to: 'cities#index' ``` Chuyển thành: ``` resources :cities, only: [:index] ```
  • thanhnd @thanhnd

    added 1 commit

    • 704c20ee - fix review 20200407 1

    Compare with previous version

    Apr 07, 2020

    added 1 commit

    • 704c20ee - fix review 20200407 1

    Compare with previous version

    added 1 commit * 704c20ee - fix review 20200407 1 [Compare with previous version](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4768&start_sha=b61c33205210ff42de945ce6339832d968bcec5e)
    Toggle commit list
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Apr 08, 2020
    Last updated by thanhnd Apr 08, 2020
    app/assets/stylesheets/cities.scss 0 → 100644
    1 // Place all the styles related to the cities controller here.
    • Ba Toi Dang @toidb commented Apr 08, 2020
      Master

      @thanhnd xóa nhưng file không sử dung.

      @thanhnd xóa nhưng file không sử dung.
    • thanhnd @thanhnd

      changed this line in version 8 of the diff

      Apr 08, 2020

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4773&start_sha=704c20ee77e7330d66477ba234d7b9c8cd1f6d98#82d2ae052375bfa48c0f6226535c344660517588_1_0)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Apr 08, 2020
    Last updated by thanhnd Apr 08, 2020
    app/assets/stylesheets/cities.scss 0 → 100644
    1 // Place all the styles related to the cities controller here.
    2 // They will automatically be included in application.css.
    • Ba Toi Dang @toidb commented Apr 08, 2020
      Master

      @thanhnd xóa nhưng file không sử dung.

      @thanhnd xóa nhưng file không sử dung.
    • thanhnd @thanhnd

      changed this line in version 8 of the diff

      Apr 08, 2020

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4773&start_sha=704c20ee77e7330d66477ba234d7b9c8cd1f6d98#82d2ae052375bfa48c0f6226535c344660517588_2_0)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Apr 08, 2020
    Last updated by thanhnd Apr 08, 2020
    app/assets/stylesheets/industries.scss 0 → 100644
    1 // Place all the styles related to the industries controller here.
    • Ba Toi Dang @toidb commented Apr 08, 2020
      Master

      @thanhnd xóa nhưng file không sử dung.

      @thanhnd xóa nhưng file không sử dung.
    • thanhnd @thanhnd

      changed this line in version 8 of the diff

      Apr 08, 2020

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4773&start_sha=704c20ee77e7330d66477ba234d7b9c8cd1f6d98#53be1692cad40d36c9e93f0ebcf6e0d987ad32d1_1_0)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Apr 08, 2020
    Last updated by thanhnd Apr 08, 2020
    app/models/city.rb
    2 2 belongs_to :area
    3 3 has_many :jobs
    4 4 validates_presence_of :city_name
    5 scope :top_city_by_job, ->{joins(:jobs).select('cities.*, COUNT(jobs.id) as job_count').group('jobs.city_id').order(:job_count).last(9)}
    5
    6 def self.top_cities_by_job
    7 City.joins(:jobs).select('cities.*, COUNT(jobs.id) as job_count').group('jobs.city_id').order(:job_count).reverse_order.first(9)
    • Ba Toi Dang @toidb commented Apr 08, 2020
      Master
      City.joins(:jobs).select('cities.*, COUNT(jobs.id) as job_count').group('jobs.city_id').order(:job_count).reverse_order.first(9)

      =>

      joins(:jobs).select('cities.*, COUNT(jobs.id) as job_count').group('jobs.city_id').order(:job_count).reverse_order.first(9)

      Làm vậy để giữ chain query của active_record. Anh check các chỗ khác nha.

      Edited Apr 08, 2020 by Ba Toi Dang
      ``` City.joins(:jobs).select('cities.*, COUNT(jobs.id) as job_count').group('jobs.city_id').order(:job_count).reverse_order.first(9) ``` => ``` joins(:jobs).select('cities.*, COUNT(jobs.id) as job_count').group('jobs.city_id').order(:job_count).reverse_order.first(9) ``` Làm vậy để giữ chain query của active_record. Anh check các chỗ khác nha.
    • thanhnd @thanhnd

      changed this line in version 8 of the diff

      Apr 08, 2020

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4773&start_sha=704c20ee77e7330d66477ba234d7b9c8cd1f6d98#28495972e963898abf2919ffeaeb92fbdf49fb8e_7_9)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Apr 08, 2020
    Last updated by thanhnd Apr 08, 2020
    app/models/industry.rb
    2 2 has_many :industry_jobs
    3 3 has_many :jobs
    4 4 validates_presence_of :industry_name
    5 scope :top_industry_by_job, ->{joins(:jobs).select('industries.*, COUNT(jobs.id) as job_count').group('jobs.industry_id').order(:job_count).last(9)}
    5
    6 def self.top_industries_by_job
    7 Industry.joins(:jobs).select('industries.*, COUNT(jobs.id) as job_count').group('jobs.industry_id').order(:job_count).last(9)
    • Ba Toi Dang @toidb commented Apr 08, 2020
      Master

      @thanhnd không sử dụng magic number 9 di chuyển các biến số thành 1 constant. Anh kiểm tra những chỗ khác nha.

      http://zigexn-ventura.github.io/magic-number-and-handling-in-rails/

      Edited Apr 08, 2020 by Ba Toi Dang
      @thanhnd không sử dụng magic number `9` di chuyển các biến số thành 1 constant. Anh kiểm tra những chỗ khác nha. http://zigexn-ventura.github.io/magic-number-and-handling-in-rails/
    • thanhnd @thanhnd

      changed this line in version 8 of the diff

      Apr 08, 2020

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4773&start_sha=704c20ee77e7330d66477ba234d7b9c8cd1f6d98#6fd7ec4bda80a3376d591b3e766bce8bf035c4c6_7_9)
      Toggle commit list
    Please register or sign in to reply
  • thanhnd @thanhnd

    added 1 commit

    • 2f8c9a9a - fix review 20200408 1

    Compare with previous version

    Apr 08, 2020

    added 1 commit

    • 2f8c9a9a - fix review 20200408 1

    Compare with previous version

    added 1 commit * 2f8c9a9a - fix review 20200408 1 [Compare with previous version](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4773&start_sha=704c20ee77e7330d66477ba234d7b9c8cd1f6d98)
    Toggle commit list
  • thanhnd @thanhnd

    added 1 commit

    • f8e30777 - fix review 20200408 2

    Compare with previous version

    Apr 08, 2020

    added 1 commit

    • f8e30777 - fix review 20200408 2

    Compare with previous version

    added 1 commit * f8e30777 - fix review 20200408 2 [Compare with previous version](https://gitlab.zigexn.vn/thanhnd/venjob_thanhnd/merge_requests/5/diffs?diff_id=4774&start_sha=2f8c9a9a9c5673ac2ee6059783924bbe72ff810b)
    Toggle commit list
  • Ba Toi Dang @toidb

    enabled an automatic merge when the pipeline for f8e30777 succeeds

    Apr 08, 2020

    enabled an automatic merge when the pipeline for f8e30777 succeeds

    enabled an automatic merge when the pipeline for f8e30777f6f90ed825b0761fd484d0d5f362850a succeeds
    Toggle commit list
  • Ba Toi Dang @toidb

    closed

    Apr 08, 2020

    closed

    closed
    Toggle commit list
  • Ba Toi Dang @toidb

    reopened

    Apr 08, 2020

    reopened

    reopened
    Toggle commit list
  • Ba Toi Dang @toidb

    canceled the automatic merge

    Apr 08, 2020

    canceled the automatic merge

    canceled the automatic merge
    Toggle commit list
  • Ba Toi Dang @toidb

    enabled an automatic merge when the pipeline for f8e30777 succeeds

    Apr 08, 2020

    enabled an automatic merge when the pipeline for f8e30777 succeeds

    enabled an automatic merge when the pipeline for f8e30777f6f90ed825b0761fd484d0d5f362850a succeeds
    Toggle commit list
  • Ba Toi Dang @toidb

    canceled the automatic merge

    Apr 08, 2020

    canceled the automatic merge

    canceled the automatic merge
    Toggle commit list
  • Ba Toi Dang @toidb

    mentioned in commit 6a010474

    Apr 08, 2020

    mentioned in commit 6a010474

    mentioned in commit 6a0104747e2b7d2a9c8371e1ee070610ee1456e7
    Toggle commit list
  • Ba Toi Dang @toidb

    merged

    Apr 08, 2020

    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
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
4
4 participants
Reference: thanhnd/venjob_thanhnd!5
×

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.