```ruby
module MongoProfiler
  class ProfileGroup
    include Mongoid::Document
    include Mongoid::Timestamps

    field :name, type: String

    has_many :profiles

    index name: 1
  end
end
```

Delete related profiles when deleting groups
user
```ruby
module MongoProfiler
  class ProfileGroup
    include Mongoid::Document
    include Mongoid::Timestamps

    field :name, type: String

    has_many :profiles, dependent: :delete

    index name: 1
  end
end
```
assistant