jt-rails-tokenizable 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 462e94c2e5a11c38ff8a67a7a1825fbbdf0f93c6
4
- data.tar.gz: 15d366c6611ca889d7f535b69eeb44bed4a46c6e
3
+ metadata.gz: bd3a1fdd162acea159dcb9696048c6b4bd478d53
4
+ data.tar.gz: 894136cf6a6f0770ce7c67417998861796f25753
5
5
  SHA512:
6
- metadata.gz: 23dd771ed76f229884dbfbf577db1e9ea612170e9864cc3c0c051c862b2dbfeff502ea18e84406739676a7a9470aa2b2447c368ae1cc53c5d07d01750173051e
7
- data.tar.gz: a7a966ee73c4526529e413d8f9b85e30eab1f0fde604295bff0a25f5df45e7f0a2981d0fe4c0effe40c698475c6c1f1bdfbe5e04f5f60f3628559a3937d603b0
6
+ metadata.gz: 1abf26871c42cb899308b3921f136cb70801de3990df35f9f3caff3c59d591768342cecadeb73795195f5cec571ad4e4ef5768a6abc2bfc8fbe7c5f5854ac620
7
+ data.tar.gz: 9525c09da182f13458ecc91578c22c2fc8b3b65ef987aa7b36d25774a1708a29ab9838ecd699ec000ffe19bf3f68406844dc16531ff1a2304c14c313a392c2cb
data/README.md CHANGED
@@ -24,7 +24,7 @@ class User < ActiveRecord::Base
24
24
  end
25
25
  ```
26
26
 
27
- You change the length of the token (128 by default) and disable the presence and uniqueness validations.
27
+ You can change the size of the token (32 by default, which means 64 caracters) and disable the presence and uniqueness validations. The generation of token is using `SecureRandom.hex` method.
28
28
 
29
29
  A new unique token is generated at the creation of the model. You can generate a new token with:
30
30
 
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.summary = "Token generation for ActiveRecord models in Ruby On Rails"
4
4
  s.description = "Generate tokens for ActiveRecord models in Ruby On Rails"
5
5
  s.homepage = 'https://github.com/jonathantribouharet/jt-rails-tokenizable'
6
- s.version = '1.0.5'
6
+ s.version = '1.0.6'
7
7
  s.files = `git ls-files`.split("\n")
8
8
  s.require_paths = ['lib']
9
9
  s.authors = ['Jonathan TRIBOUHARET']
data/lib/tokenize.rb CHANGED
@@ -28,7 +28,7 @@ module JT::Rails::Tokenizable::Tokenize
28
28
  end
29
29
 
30
30
  def generate_new_token(field)
31
- size = jt_rails_token_fields[field.to_sym].fetch(:size, 128)
31
+ size = jt_rails_token_fields[field.to_sym].fetch(:size, 32)
32
32
 
33
33
  self[field.to_sym] = loop do
34
34
  random_token = SecureRandom.hex(size)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jt-rails-tokenizable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan TRIBOUHARET
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-15 00:00:00.000000000 Z
11
+ date: 2015-07-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Generate tokens for ActiveRecord models in Ruby On Rails
14
14
  email: jonathan.tribouharet@gmail.com