Commit 07fcf73b by Đường Sỹ Hoàng

Removed files

parent 4276fcb8
// Place all the styles related to the city controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/
// Place all the styles related to the Industries controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/
...@@ -2,5 +2,5 @@ class CitiesController < ApplicationController ...@@ -2,5 +2,5 @@ class CitiesController < ApplicationController
def index def index
@top_vn_cities = City.sort_top_vn_cities @top_vn_cities = City.sort_top_vn_cities
@top_inter_cities = City.sort_top_inter_cities @top_inter_cities = City.sort_top_inter_cities
end @top_cities = City.sort_top_cities
end end
...@@ -7,11 +7,11 @@ class City < ApplicationRecord ...@@ -7,11 +7,11 @@ class City < ApplicationRecord
end end
def self.sort_top_vn_cities def self.sort_top_vn_cities
@vn_cities ||= City.where(region: 0).sort_by(&:jobs_count).reject{ |city| city.jobs_count.zero? }.reverse.take(Settings.top.city.limit) @vn_cities ||= where(region: 0).sort_by(&:jobs_count).reject{ |city| city.jobs_count.zero? }.reverse.take(Settings.top.city.limit)
end end
def self.sort_top_inter_cities def self.sort_top_inter_cities
@inter_cities ||= City.where(region: 1).sort_by(&:jobs_count).reject{ |city| city.jobs_count.zero? }.reverse.take(Settings.top.city.limit) @inter_cities ||= where(region: 1).sort_by(&:jobs_count).reject{ |city| city.jobs_count.zero? }.reverse.take(Settings.top.city.limit)
end end
def jobs_count def jobs_count
......
require 'test_helper'
class CityControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class IndustriesControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
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 to comment