我有以下模型结构:
class Job < ApplicationRecord
belongs_to :location
has_and_belongs_to_many :users
end
class Location < ApplicationRecord
has_and_belongs_to_many :users
has_many :jobs
end
class User < ApplicationRecord
has_and_belongs_to_many :locations
end
active
@users = @job.location.users.where(users: { id: @job.user_ids }).or(@job.location.users.where(active: true))
ArgumentError (Relation passed to #or must be structurally compatible. Incompatible values: [:references]):
提前谢谢。