https://github.com/mamantoha/mongoid-suicide
Provides method to remove fields from Mongoid models. Including associations and validations.
https://github.com/mamantoha/mongoid-suicide
mongodb mongoid ruby
Last synced: 4 months ago
JSON representation
Provides method to remove fields from Mongoid models. Including associations and validations.
- Host: GitHub
- URL: https://github.com/mamantoha/mongoid-suicide
- Owner: mamantoha
- License: mit
- Created: 2015-03-25T12:50:42.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2026-01-14T11:27:28.000Z (5 months ago)
- Last Synced: 2026-02-12T15:54:31.553Z (4 months ago)
- Topics: mongodb, mongoid, ruby
- Language: Ruby
- Homepage:
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README

[](https://github.com/mamantoha/mongoid-suicide/actions/workflows/ruby.yml)
[](https://badge.fury.io/rb/mongoid-suicide)
Provides methods to remove fields from Mongoid models
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'mongoid-suicide'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install mongoid-suicide
## Usage
Set up a `Mongoid::Suicide`:
```ruby
class Person
include Mongoid::Document
include Mongoid::Suicide
field :username, type: String
end
p = Person.first
p.username
=> ...
```
Remove a field from a document:
```ruby
Person.remove_field(:username)
p = Person.first
p.username
=> NoMethodError: undefined method `username'
```
## Contributing
1. Fork it ( https://github.com/mamantoha/mongoid-suicide/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## License and Author
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Copyright (c) 2015-2026 by Anton Maminov