Create database
I have created db follow document (https://docs.google.com/spreadsheets/u/1/d/1Lf3KTGjaBN4qH4Q8e1nif03GdImteCfDp_1G_gZPDls/edit#gid=0), you can see db diagram at https://drive.google.com/file/d/0B6GfH1MD57e7RzBZZFZCSnZlek0/view.
-
-
-
app/models/user.rb 0 → 100644
1 class User < ApplicationRecord 2 has_many :apply_jobs 3 has_many :jobs, through: :favorite_jobs -
MasterEdited by Ba Toi Dang
Có 2 dòng
has_many :jobs, through: :favorite_jobsduplicate assoc rôi @trunglx check lại nhé.P/S: Kiểm tra những chỗ khác.
-
-
Master
Fixed.
-
-
app/models/job.rb 0 → 100644
1 class Job < ApplicationRecord 2 belongs_to :city 3 belongs_to :company 4 has_many :apply_jobs 5 has_many :users, through: :favorite_jobs 6 has_many :favorite_jobs 7 has_many :users, through: :favorite_jobs -
Master
fixed
-
Master
@trunglx
has_many :usersbị trùng tên assocation là không được nhé :).Tham khảo: http://guides.rubyonrails.org/association_basics.html
-
-
app/models/industries_job.rb 0 → 100644
1 class IndustriesJob < ApplicationRecord -
MasterEdited by Ba Toi Dang
Tôi nghĩ không cần model này
IndustriesJobbởi vì nó chỉ là bảng trung gian giữa 2 model. Và sử dụng quan hệhas_and_belongs_to_manykhai báo mối quan hệ giữa 2 model. -
-
Master
Fixed.
-
-
app/models/industry.rb 0 → 100644
1 class Industry < ApplicationRecord 2 has_many :industries_jobs 3 has_many :jobs, through: :industries_jobs -
Master
Có thể sử dụng quan hệ
has_and_belongs_to_manyở đây.P/S: kiểm tra những chỗ khác.
-
-
Master
Fixed.
-
-
app/models/industry.rb 0 → 100644
1 class Industry < ApplicationRecord 2 has_many :industries_jobs 3 has_many :jobs, through: :industries_jobs -
Master
Có thể sử dụng quan hệ
has_and_belongs_to_manyở đây.P/S: kiểm tra những chỗ khác.
-
-
Master
Fixed.
-
-
-
test/fixtures/industries_jobs.yml 0 → 100644
1 # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -
-
Master
Deleted this file.
-
Toggle commit list
-
added 1 commit
- 77586e05 - fix duplication association error and delete industries_job_test file.
Toggle commit list -
added 1 commit
- 37c2419d - fix duplicate association eroor and delete industries_job_test.rb
Toggle commit list -
merged
Toggle commit list