Sha256: 6dc71588670f5fd8a51cbf475836d55e9257fc136ac9d2b454521a9aa96ca073
Contents?: true
Size: 961 Bytes
Versions: 2
Compression:
Stored size: 961 Bytes
Contents
# activemodel-immutable_validator [![Build Status](https://travis-ci.org/yuku-t/activemodel-immutable_validator.svg?branch=master)](https://travis-ci.org/yuku-t/activemodel-immutable_validator) [![Code Climate](https://codeclimate.com/github/yuku-t/activemodel-immutable_validator/badges/gpa.svg)](https://codeclimate.com/github/yuku-t/activemodel-immutable_validator) [![Coverage Status](https://coveralls.io/repos/yuku-t/activemodel-immutable_validator/badge.svg)](https://coveralls.io/r/yuku-t/activemodel-immutable_validator) Validate immutable attributes. ## Usage Add to your Gemfile: ```rb gem 'activemodel-immutable_validator' ``` Run: ``` bundle install ``` Then add the followng to your model which belongs to a user: ```rb validates :attr, immutable: true ``` ### Sample A human cannot become a bot vice versa. ```rb class User < ActiveRecord::Base validated :type, immutable: true end class Bot < User end class Human < User end ```
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activemodel-immutable_validator-0.0.2 | README.md |
activemodel-immutable_validator-0.0.1 | README.md |