No commit activity in last 3 years
No release in over 3 years
Tokenize attributes in active record object.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 4.0.0, ~> 4.0
~> 10.0
~> 2.14
 Project Readme

TokenizeAttributes

TokenizeAttributes allows to define a tokenized attribute.

A before validation is generate on the attribute to set a tokenized value on the attribute

Installation

  gem 'tokenize_attributes', '~> 0.1.1'

Configuration

TokenizeAttributes.configure do |config|
  config.tokenizer = proc { SecureRandom.hex }
end

Usage

Tokenized attributes

class Object
    tokenized_attributes :attrb1, :attrb2
end

Override tokenizer proc

class Object
    tokenized_attributes :attrb1, :attrb2, proc { SecureRandom.uuid }
end

Reset Attrb

object = Object.new
object.reset_tokenization_for_attrb

License

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