Sha256: fa514b36766a996de9f2b15c6ce312efacb4260af0e4ed07c739db17dd4732f9
Contents?: true
Size: 1.14 KB
Versions: 1
Compression:
Stored size: 1.14 KB
Contents
# JTRailsTokenizable [![Gem Version](https://badge.fury.io/rb/jt-rails-tokenizable.svg)](http://badge.fury.io/rb/jt-rails-tokenizable) JTRailsTokenizable generates tokens for ActiveRecord models in Ruby On Rails. ## Installation JTRailsTokenizable is distributed as a gem, which is how it should be used in your app. Include the gem in your Gemfile: gem 'jt-rails-tokenizable', '~> 1.0' ## Usage ### Basic usage Include `JT::Rails::Tokenizable` in your model: ```ruby class User < ActiveRecord::Base include JT::Rails::Tokenizable tokenize :my_token_field tokenize :another_token_field, size: 20, validations: false ... end ``` You change the length of the token (128 by default) and disable the presence and uniqueness validations. A new unique token is generated at the creation of the model. You can generate a new token with: ```ruby my_instance.generate_new_token(:my_token_field) my_instance.save ``` ## Author - [Jonathan Tribouharet](https://github.com/jonathantribouharet) ([@johntribouharet](https://twitter.com/johntribouharet)) ## License JTRailsTokenizable is released under the MIT license. See the LICENSE file for more info.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jt-rails-tokenizable-1.0.2 | README.md |