0.0
No release in over 3 years
FuhenRecord is a Rails extension that makes ActiveRecord models immutable.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 8.1.2
 Project Readme

FuhenRecord

FuhenRecord is a Rails extension that makes ActiveRecord models immutable.

There are already a bunch of gems on RubyGems that do similar things. I just couldn’t find one that felt actively maintained, so I made this.

(That said, I can’t guarantee this gem will stay well-maintained forever.)

Installation

Add this line to your application's Gemfile:

gem "fuhen_record"

And then execute:

$ bundle

Usage

To make your model immutable, add immutable_record like this:

class AccessLog < ApplicationRecord
  immutable_record
end

Contributing

Contribute however you like.

AI-generated contribution guide, just in case:

  1. Fork the repository
  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

The gem is available as open source under the terms of the MIT License.