Froegin keys
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -1,2 +1,4 @@
|
||||
class Job < ApplicationRecord
|
||||
|
||||
has_many :device_jobs
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user