Froegin keys

This commit is contained in:
2021-10-26 12:44:05 +02:00
parent f76b125f84
commit beec4a00de
8 changed files with 37 additions and 10 deletions

View File

@@ -46,6 +46,6 @@ class DeviceJobsController < ApplicationController
# Only allow a list of trusted parameters through.
def device_job_params
params.require(:device_job).permit(:device_id, :jobs_id, :status)
params.require(:device_job).permit(:device_id, :job_id, :status)
end
end

View File

@@ -46,6 +46,6 @@ class JobsController < ApplicationController
# Only allow a list of trusted parameters through.
def job_params
params.require(:job).permit(:job_id, :params, :type)
params.require(:job).permit(:job_id, :params, :job_type)
end
end

View File

@@ -1,2 +1,7 @@
class DeviceJob < ApplicationRecord
end
# self.primary_key = :jobs_id, :device_id
belongs_to :job
belongs_to :device
# :foreign_key => [:user_id, :group_id]
end

View File

@@ -1,2 +1,4 @@
class Job < ApplicationRecord
has_many :device_jobs
end