Immortal
Make any ActiveRecord model paranoid by just including Immortal, and instead of being deleted from the database, the object will just marked as 'deleted' with a boolean field in the database.
Install / Use
/learn @redbooth/ImmortalREADME
Immortal
Make any ActiveRecord model paranoid by just including Immortal, and instead
of being deleted from the database, the object will just marked as 'deleted'
with a boolean field in the database.
Installation
Add the gem dependency to your Gemfile:
gem 'immortal'
Usage
class User < ActiveRecord::Base
include Immortal
end
And add a boolean field called deleted to that model:
class AddDeletedToUsers < ActiveRecord::Migration
def self.up
add_column :users, :deleted, :boolean
end
def self.down
remove_column :users, :deleted
end
end
TODO
- Add documentation in the code
Contributing
If you want to improve immortal
- Fork the repo
- Create a topic branch
git checkout -b my_feature - Push it!
git push origin my_feature - Open a pull request
Related Skills
feishu-drive
343.1k|
things-mac
343.1kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
343.1kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
codebase-memory-mcp
1.1kHigh-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 66 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.
