As requested, I'll move my comment into an answer:
I recommend creating an :owner_id
field for each project and then creating a has_and_belongs_to_many
relationship between the User
and Project
models. Then create some simple functions to determine who the owner of a project is, who the collaborators are etc
# app/models/project.rb
class Project
include Mongoid::Document
include Mongoid::Timestamps
field :title, type: String
field :summary, type: String
field :permalink, type: String
field :owner_id, type: String
has_and_belongs_to_many :users
def is_owner?(owner_object)
return self.owner_id == owner_object.id
end
# Add more functions here based on your needs
end