Added user model and fixed reference in migration
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
class Job < ApplicationRecord
|
||||
belongs_to :operator_id
|
||||
belongs_to :costumer_id
|
||||
belongs_to :operator, class_name: 'User', optional: true
|
||||
belongs_to :costumer, class_name: 'User', optional: true
|
||||
end
|
||||
|
||||
3
app/models/user.rb
Normal file
3
app/models/user.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class User < ApplicationRecord
|
||||
has_many :Jobs, foreign_key: :costumer_id
|
||||
end
|
||||
Reference in New Issue
Block a user