{"id":41758977,"url":"https://github.com/ream88/mongoid-paranoia","last_synced_at":"2026-01-25T02:05:45.116Z","repository":{"id":7139172,"uuid":"8436059","full_name":"ream88/mongoid-paranoia","owner":"ream88","description":"Paranoid Documents for Mongoid 4+","archived":false,"fork":false,"pushed_at":"2017-04-04T01:46:05.000Z","size":98,"stargazers_count":9,"open_issues_count":3,"forks_count":13,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-14T00:19:26.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ream88.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-26T15:57:59.000Z","updated_at":"2022-03-11T18:21:09.000Z","dependencies_parsed_at":"2022-09-08T00:41:40.716Z","dependency_job_id":null,"html_url":"https://github.com/ream88/mongoid-paranoia","commit_stats":null,"previous_names":["haihappen/mongoid-paranoia"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ream88/mongoid-paranoia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ream88%2Fmongoid-paranoia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ream88%2Fmongoid-paranoia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ream88%2Fmongoid-paranoia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ream88%2Fmongoid-paranoia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ream88","download_url":"https://codeload.github.com/ream88/mongoid-paranoia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ream88%2Fmongoid-paranoia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28741649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T01:40:51.112Z","status":"online","status_checked_at":"2026-01-25T02:00:06.841Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-25T02:05:44.420Z","updated_at":"2026-01-25T02:05:45.109Z","avatar_url":"https://github.com/ream88.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongoid-paranoia [![Build Status](https://travis-ci.org/ream88/mongoid-paranoia.png)](https://travis-ci.org/ream88/mongoid-paranoia)\n\n**Important:** This gem is an extraction of [Mongoid::Paranoia](http://mongoid.github.io/en/mongoid/docs/extras.html#paranoia) from the official [mongoid](http://mongoid.org) gem.\nSince Mongoid::Paranoia was removed in the `4.0.0` release of Mongoid, this gem re-enables the functionality of paranoid documents.\n\n**Please submit only bug and security fixes**. Neither I will accept new features nor changes to existing APIs.\n\n**Attention:** There are two similarly named gems out there: `mongoid-paranoia` and `mongoid_paranoia`\n\n* `mongoid-paranoia`'s (this one) goal is to stay API compatible, which comes at the cost of (breaking) API changes to be rejected. If you're updating a Mongoid 3.x app to Mongoid 4+ and you depend on `Mongoid::Paranoia` this gem is recommended for continuity.\n\n* However if your code is working and you want new features, for example a `*_restore` callback, you should head over to @simi's `mongoid_paranoia` gem at https://github.com/simi/mongoid_paranoia. He is doing a great job there and is willing to accept your PRs ;)\n\n---\n\nThere may be times when you don't want documents to actually get deleted from the database, but \"flagged\" as deleted. Mongoid provides a Paranoia module to give you just that.\n\n## Installation\n\nIn your Gemfile:\n\n```ruby\ngem 'mongoid-paranoia'\n```\n\n## Usage\n\n```ruby\nclass Person\n  include Mongoid::Document\n  include Mongoid::Paranoia\nend\n\nperson.delete   # Sets the deleted_at field to the current time, ignoring callbacks.\nperson.delete!  # Permanently deletes the document, ignoring callbacks.\nperson.destroy  # Sets the deleted_at field to the current time, firing callbacks.\nperson.destroy! # Permanently deletes the document, firing callbacks.\nperson.restore  # Brings the \"deleted\" document back to life.\n```\n\nThe documents that have been \"flagged\" as deleted (soft deleted) can be accessed at any time by calling the deleted class method on the class.\n\n```ruby\nPerson.deleted # Returns documents that have been \"flagged\" as deleted.\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Copyright\n\n(The MIT license)\n\nCopyright (c) 2009-2013 Durran Jordan, 2013-2016 Mario Uher\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fream88%2Fmongoid-paranoia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fream88%2Fmongoid-paranoia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fream88%2Fmongoid-paranoia/lists"}