Provides method to remove fields from Mongoid models. Including associations and validations.
MIT License
Provides methods to remove fields from Mongoid models
Add this line to your application's Gemfile:
gem 'mongoid-suicide'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mongoid-suicide
Set up a Mongoid::Suicide
:
class Person
include Mongoid::Document
include Mongoid::Suicide
field :username, type: String
end
p = Person.first
p.username
=> ...
Remove a field from a document:
Person.remove_field(:username)
p = Person.first
p.username
=> NoMethodError: undefined method `username'
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)The gem is available as open source under the terms of the MIT License.
Copyright (c) 2015-2024 by Anton Maminov