私は次の協会を持っています
class Employee
include Mongoid::Document
employee_id :name
references_many :companies, stored_as => :array, :inverse_of => :employees
end
class Company
include Mongoid::Document
field :name
references_many :employees, stored_as => :array, :inverse_of => :companies
end
employee_id
今、単一の従業員の一意性を確認するにはどうすればよいですかcompany