Update the jobs table to add real reference to users table
- Added migration file to add
requestor_id
field containing the id of user requesting the job, making the field foreign key for users and deleting the existing stringrequestor
field. - Added association
belongs_to
injob.rb
foruser
with validation of presence of user andhas_many
inuser.rb
forjobs
. - Updated other files to use
requestor
association with user object - Updated tests in
spec/debci
files. - Added tests in
spec/debci/job_spec.rb
to check null value constraint data integrity constraint with foreign key validation.
Edited by Pavit Kaur