id2 - id3: cities list, industries list
Check out, review, and merge locally
Step 1. Fetch and check out the branch for this merge request
git fetch origin git checkout -b id2-id3 origin/id2-id3
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 id2-id3
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.
-
Tô Ngọc Ánh @anhtn
added 3 commits
-
7a3fadae...4e70cfdf - 2 commits from branch
master - 5c31e055 - Merge branch 'master' into 'id2-id3'
added 3 commits
-
7a3fadae...4e70cfdf - 2 commits from branch
master - 5c31e055 - Merge branch 'master' into 'id2-id3'
added 3 commits * 7a3fadae...4e70cfdf - 2 commits from branch `master` * 5c31e055 - Merge branch 'master' into 'id2-id3' [Compare with previous version](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4909&start_sha=7a3fadae80bd964eb746e7e775ca15ce6198c752)Toggle commit list -
7a3fadae...4e70cfdf - 2 commits from branch
-
1 1 <nav class='navbar navbar-expand-lg navbar-light sticky-top'> 2 <a class='navbar-brand' href='#'> 2 <a class='navbar-brand' href='<%= root_path %>'> -
Hoang Phuc Do @phucdh commentedEdited
<%= link_to root_path, class: 'navbar-brand' do %> <%= image_tag 'venjob-logo.png', alt: 'VeNJob', size: '120x50' %> <% end %>```ruby <%= link_to root_path, class: 'navbar-brand' do %> <%= image_tag 'venjob-logo.png', alt: 'VeNJob', size: '120x50' %> <% end %> ``` -
Tô Ngọc Ánh @anhtn commentedMasterEdited
dạ, thanks a ^
dạ, thanks a ^^ -
Tô Ngọc Ánh @anhtn
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in [version 4 of the diff](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4913&start_sha=3a3b04a3d423865720e364f70e1ebd86158e4e59#76d1a11ee1e940c5ee3f38422c24188edb0fe433_2_2)Toggle commit list
Please register or sign in to reply -
-
10 10 <h1>Latest Jobs</h1> 11 <hr> 11 12 <div class='row'> 12 13 <%= render partial: 'home/job', collection: @jobs %> 13 14 </div> 14 <a href='#'>All Jobs</a> 15 15 </div> 16 16 <div id='top-cities' class='my-4 text-center'> 17 17 <h1>Top Cities</h1> 18 <hr> 18 19 <div class='row'> 19 <%= render partial: 'home/city', collection: @top_cities, as: :location %> 20 <%= render partial: 'locations/city', collection: @top_cities, as: :location %> 20 21 </div> 21 <a href='#'>All Cities</a> 22 <a href='<%= cities_path %>'>All Cities</a> -
Thanh Hung Pham @hungpt commentedMaster
-
Tô Ngọc Ánh @anhtn commentedMasterEdited
ok a, quên mất có cái này :D
ok a, quên mất có cái này :D -
Tô Ngọc Ánh @anhtn
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in [version 4 of the diff](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4913&start_sha=3a3b04a3d423865720e364f70e1ebd86158e4e59#3bf63da9a86734af839552d26556a28fb7456f0c_22_22)Toggle commit list
-
-
Tô Ngọc Ánh @anhtn
added 2 commits
added 2 commits
added 2 commits * 1f4b8912 - id3 industries list * 3a3b04a3 - Merge branch 'id2-id3' of gitlab.zigexn.vn:anhtn/VeNJob into id2-id3 [Compare with previous version](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4912&start_sha=5c31e055ffad6c99f02f7142874db991e633dc69)Toggle commit list -
Tô Ngọc Ánh @anhtn
resolved all discussions
resolved all discussions
resolved all discussionsToggle commit list -
Tô Ngọc Ánh @anhtn
added 1 commit
- 6292354d - change html a tag to link_to
added 1 commit * 6292354d - change html a tag to link_to [Compare with previous version](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4913&start_sha=3a3b04a3d423865720e364f70e1ebd86158e4e59)Toggle commit list -
Tô Ngọc Ánh @anhtn
added 1 commit
- 148f59aa - Refactor code to improve performance
added 1 commit * 148f59aa - Refactor code to improve performance [Compare with previous version](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4920&start_sha=6292354db126fdb42dead0d0b2fc9730454187e1)Toggle commit list -
app/controllers/locations_controller.rb 0 → 100644
1 class LocationsController < ApplicationController 2 def index 3 @vn_cities_lists = Location.vietnam.count_job -
Thanh Hung Pham @hungpt commentedMasterEdited
@anhtn Nên sử dung
count_jobtrong scope giống như scopetop_locationsá em.@anhtn Nên sử dung `count_job` trong scope giống như scope `top_locations` á em. -
Tô Ngọc Ánh @anhtn commentedMasterEdited
em tách ra vì nghĩ sau này có thể có chỗ cần lấy ra những city thuộc/không thuộc Việt Nam mà k quan tâm tới số lượng job á a (dùng
count_jobsẽ bị mất các Location k có job nào)em tách ra vì nghĩ sau này có thể có chỗ cần lấy ra những city thuộc/không thuộc Việt Nam mà k quan tâm tới số lượng job á a (dùng `count_job` sẽ bị mất các Location k có job nào) -
Thanh Hung Pham @hungpt commentedMasterEdited
@anhtn Vậy em sửa lại tên method
count_jobnha. Đọc vào sẽ hiểu là em trả về số lượng job. sửa thànhwith_job_countchẳng hạn.@anhtn Vậy em sửa lại tên method `count_job` nha. Đọc vào sẽ hiểu là em trả về số lượng job. sửa thành `with_job_count` chẳng hạn. -
Tô Ngọc Ánh @anhtn
changed this line in version 6 of the diff
changed this line in version 6 of the diff
changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4926&start_sha=148f59aa4fc543b65410b2a97eac265ea52a1216#a87af5d37eecb8c19aa743bac5a81ae1c9d2cf1b_3_3)Toggle commit list
-
-
app/views/locations/index.html.erb 0 → 100644
4 <ul class='list-group list-group-horizontal'> 5 <li class='list-group-item'> 6 <a href='#vietnam'>Việt Nam</a> 7 <span class='badge badge-primary badge-pill'><%= @vn_cities_lists.length %></span> 8 </li> 9 <li class='list-group-item'> 10 <a href='#international'>International</a> 11 <span class='badge badge-primary badge-pill'><%= @internal_cities_lists.length %></span> 12 </li> 13 </ul> 14 </div> 15 <div id='vietnam' class='text-center'> 16 <h2>Vietnam</h2> 17 <hr> 18 <div class='row'> 19 <%= render partial: 'locations/city', collection: @vn_cities_lists, as: :location %> -
Thanh Hung Pham @hungpt commentedMasterEdited
@anhtn Sửa tên file
locations/city==>locations/location@anhtn Sửa tên file `locations/city` ==> `locations/location` -
Tô Ngọc Ánh @anhtn
changed this line in version 6 of the diff
changed this line in version 6 of the diff
changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4926&start_sha=148f59aa4fc543b65410b2a97eac265ea52a1216#9ba75d5e1f9677114ad6ee44154ea86162d79911_19_17)Toggle commit list
-
-
app/views/locations/index.html.erb 0 → 100644
11 <span class='badge badge-primary badge-pill'><%= @internal_cities_lists.length %></span> 12 </li> 13 </ul> 14 </div> 15 <div id='vietnam' class='text-center'> 16 <h2>Vietnam</h2> 17 <hr> 18 <div class='row'> 19 <%= render partial: 'locations/city', collection: @vn_cities_lists, as: :location %> 20 </div> 21 </div> 22 <div id='international' class='text-center'> 23 <h2>International</h2> 24 <hr> 25 <div class="row"> 26 <%= render partial: 'locations/city', collection: @internal_cities_lists, as: :location %> -
Thanh Hung Pham @hungpt commentedMaster
-
Tô Ngọc Ánh @anhtn
changed this line in version 6 of the diff
changed this line in version 6 of the diff
changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4926&start_sha=148f59aa4fc543b65410b2a97eac265ea52a1216#9ba75d5e1f9677114ad6ee44154ea86162d79911_26_24)Toggle commit list
-
-
2 2 <div class='card'> 3 3 <%= link_to '#', class: 'card-body text-decoration-none' do %> 4 4 <h5 class='card-title font-weight-bold'><%= industry.name %></h5> 5 <p class='card-text'><%= industry.jobs.size %> Jobs</p> 5 <p class='card-text'><%= industry.job_count %> Jobs</p> -
Thanh Hung Pham @hungpt commentedMaster
-
Tô Ngọc Ánh @anhtn
changed this line in version 6 of the diff
changed this line in version 6 of the diff
changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4926&start_sha=148f59aa4fc543b65410b2a97eac265ea52a1216#759f2125c06eb65fc6da7108a5ebda0a4631cbcc_5_5)Toggle commit list
-
-
1 1 class Industry < ApplicationRecord 2 scope :top_industries, ->(number) { joins(:jobs) 3 .group(:industry_id) 4 .order(Arel.sql('count(jobs.id) DESC')) 5 .take(number) } 6 2 scope :count_job, -> { joins(:jobs).group(:industry_id).select('industries.*, count(jobs.id) as job_count') } 3 scope :top_industries, ->(number) { count_job.order(Arel.sql('count(jobs.id) DESC')).limit(number) } -
Thanh Hung Pham @hungpt commentedMasterEdited
@anhtn Chỗ này dùng
count_jobđể order. vậycount(jobs.id) DESCsửa thànhjob_count DESCđược không nhỉ ?@anhtn Chỗ này dùng `count_job` để order. vậy `count(jobs.id) DESC` sửa thành `job_count DESC` được không nhỉ ? -
Tô Ngọc Ánh @anhtn
changed this line in version 6 of the diff
changed this line in version 6 of the diff
changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4926&start_sha=148f59aa4fc543b65410b2a97eac265ea52a1216#6fd7ec4bda80a3376d591b3e766bce8bf035c4c6_3_2)Toggle commit list
-
-
1 1 class Location < ApplicationRecord 2 scope :top_locations, ->(number) { joins(:jobs) 3 .group(:location_id) 4 .order(Arel.sql('count(jobs.id) DESC')) 5 .take(number) } 6 2 scope :count_job, -> { joins(:jobs).group(:location_id).select('locations.*, count(jobs.id) as job_count') } 3 scope :top_locations, ->(number) { count_job.order(Arel.sql('job_count DESC')).limit(number) } -
Thanh Hung Pham @hungpt commentedMaster
-
Tô Ngọc Ánh @anhtn
changed this line in version 6 of the diff
changed this line in version 6 of the diff
changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4926&start_sha=148f59aa4fc543b65410b2a97eac265ea52a1216#70c56d46aed1dd72ba96b4e9cf25483c48cad991_3_2)Toggle commit list
-
-
Tô Ngọc Ánh @anhtn
added 1 commit
- f57206c1 - Fix bug index industry page, refactor code
added 1 commit * f57206c1 - Fix bug index industry page, refactor code [Compare with previous version](https://gitlab.zigexn.vn/anhtn/VeNJob/merge_requests/8/diffs?diff_id=4926&start_sha=148f59aa4fc543b65410b2a97eac265ea52a1216)Toggle commit list -
Tô Ngọc Ánh @anhtn
resolved all discussions
resolved all discussions
resolved all discussionsToggle commit list -
Tô Ngọc Ánh @anhtn
mentioned in commit e2407a16
mentioned in commit e2407a16
mentioned in commit e2407a16d09d46d44d5c5686114a413a976d81e8Toggle commit list -
Tô Ngọc Ánh @anhtn
merged
merged
mergedToggle commit list