Commit 8ef1850c by nnnghia98

first edit this branch

parent 98be312e
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
# #
class City < ApplicationRecord class City < ApplicationRecord
<<<<<<< HEAD
scope :vn_cities, -> {where region: "Việt Nam"} scope :vn_cities, -> {where region: "Việt Nam"}
scope :inter_cities, -> {where region: "#"} scope :inter_cities, -> {where region: "#"}
=======
has_many :city_jobs
>>>>>>> first edit this branch
end end
...@@ -22,4 +22,12 @@ ...@@ -22,4 +22,12 @@
class CityJob < ApplicationRecord class CityJob < ApplicationRecord
belongs_to :city belongs_to :city
belongs_to :job belongs_to :job
def city_id
self.city.id
end
def job_id
self.job.id
end
end end
...@@ -30,4 +30,6 @@ ...@@ -30,4 +30,6 @@
class Job < ApplicationRecord class Job < ApplicationRecord
belongs_to :company belongs_to :company
has_many :city_jobs
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