{"id":20547410,"url":"https://github.com/mshahzadtariq/persistable","last_synced_at":"2026-02-28T08:35:00.906Z","repository":{"id":33018828,"uuid":"36653153","full_name":"mshahzadtariq/persistable","owner":"mshahzadtariq","description":"Persist sensitive data by enabling soft delete functionality","archived":false,"fork":false,"pushed_at":"2018-09-27T07:04:31.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T20:20:55.005Z","etag":null,"topics":["gem","persistence","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mshahzadtariq.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-01T10:15:25.000Z","updated_at":"2018-10-01T12:15:16.000Z","dependencies_parsed_at":"2022-08-07T19:30:20.934Z","dependency_job_id":null,"html_url":"https://github.com/mshahzadtariq/persistable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mshahzadtariq/persistable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshahzadtariq%2Fpersistable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshahzadtariq%2Fpersistable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshahzadtariq%2Fpersistable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshahzadtariq%2Fpersistable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mshahzadtariq","download_url":"https://codeload.github.com/mshahzadtariq/persistable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshahzadtariq%2Fpersistable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29928868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"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":["gem","persistence","ruby","ruby-on-rails"],"created_at":"2024-11-16T02:08:08.273Z","updated_at":"2026-02-28T08:35:00.888Z","avatar_url":"https://github.com/mshahzadtariq.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### Persist Deleted Records for Mongoid\n===============\nSoft delete functionality for Mongoid ORM so you may recover records at later stage.\n\n#### Installation\n=======\nAdd following line to your Gemfile\n\n    gem 'persistable'\n\n  or\n\n    gem 'persistable', git: 'https://github.com/mshahzadtariq/persistable'\n\n  or\n\n    gem install persistable\n\nThen generate persistable on your sensitive model at which you need to activate soft delete functionality to preserve data\n\n    rails generate persistable:migration table_name\n\n  i.e.\n\n    rails generate persistable:migration :estimates\n\nThis will generate migration file and automatically include Persistable module to the model for which you want to enable soft delete and recovery feature\n\n    class MyModel\n      include Mongoid::Document\n      include Mongoid::Persistable\n      \n      ......\n      \n    end\n    \nand that is all. \n\n#### Usage\n=======\n\nPersist sensitive data with options to recover data.\n    \nTo persist record, call destroy method on object. It will not delete record from database but persist that so you can recover it in the future if required. \n    \n    object.destroy\n    \nIt also has two scopes\n\nonly_deleted: Fetch only deleted records of that particular model\ne.g\n\n    Model.only_deleted\n    \nwith_deleted: Fetch all records of that particular model including deleted records\ne.g\n\n    Model.with_deleted\n    \n\nTo recover records, call recover method on object\n\n    Model.only_deleted.first.recover\n\nTo permanently delete record from system/database, call delete method\n\n    object.delete\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmshahzadtariq%2Fpersistable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmshahzadtariq%2Fpersistable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmshahzadtariq%2Fpersistable/lists"}