uniqueness 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41b32d19faa7d590bc7d61cb4abc3b73606af2b3
4
- data.tar.gz: 1b5f46edc116b2d6a57d46122e06f48fe7f1f220
3
+ metadata.gz: 9753b7791871ec9245ee7be5b676e6d00ac2d31e
4
+ data.tar.gz: 2aed1250dbe66bcf7f05b5f7e57f763d8a0a7a67
5
5
  SHA512:
6
- metadata.gz: ab219f0fa3965d390b0b287cbc6c5941bff889a9612b45cde6a68379dd99037305fbaceb7db03f02f256d035b8484e6213f2d4506b76d5267fc38fe36c8957fe
7
- data.tar.gz: 28164f8565242a7cf322a925f3ce351e9fde8c8de772c4788f49b795d72d474aac0c8d3e642a33c4658f1070cf62f0462c670b1a6b67cf7408e9fe31bd880253
6
+ metadata.gz: c14cd971bca7f0be162c16005ea1fc948737664c87d0b81373bfc98516e8c72c3d66417963510cef8ce5e74d4207d746c52b63728e713f3361f16304f5c2df29
7
+ data.tar.gz: 03d4dcc976021a8ec35aeb668a6b7b0ae696f0042d0289fc92e681157988c8bc8895d5181cb4d86e1aba3c0c8879ef2ae0e45be1779dcff08920da9215b83758
data/README.md CHANGED
@@ -65,6 +65,8 @@ To generate a unique-random on the fly `Uniqueness.generate` that will produce a
65
65
 
66
66
  You can also pass some options `Uniqueness.generate(type: :human)`.
67
67
 
68
+ To regenerate a unique-random value with the same options `example.regenerate_foo`.
69
+
68
70
  ## Development
69
71
 
70
72
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 4.0.0"
6
6
 
7
- gemspec :path => "../"
7
+ gemspec path: "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- uniqueness (0.7.0)
4
+ uniqueness (0.8.0)
5
5
  activerecord (>= 4.0.0)
6
6
  railties (>= 4.0.0)
7
7
 
@@ -121,4 +121,4 @@ DEPENDENCIES
121
121
  uniqueness!
122
122
 
123
123
  BUNDLED WITH
124
- 1.14.6
124
+ 1.16.1
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 4.1.0"
6
6
 
7
- gemspec :path => "../"
7
+ gemspec path: "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- uniqueness (0.7.0)
4
+ uniqueness (0.8.0)
5
5
  activerecord (>= 4.0.0)
6
6
  railties (>= 4.0.0)
7
7
 
@@ -125,4 +125,4 @@ DEPENDENCIES
125
125
  uniqueness!
126
126
 
127
127
  BUNDLED WITH
128
- 1.14.6
128
+ 1.16.1
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 4.2.0"
6
6
 
7
- gemspec :path => "../"
7
+ gemspec path: "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- uniqueness (0.7.0)
4
+ uniqueness (0.8.0)
5
5
  activerecord (>= 4.0.0)
6
6
  railties (>= 4.0.0)
7
7
 
@@ -150,4 +150,4 @@ DEPENDENCIES
150
150
  uniqueness!
151
151
 
152
152
  BUNDLED WITH
153
- 1.14.6
153
+ 1.16.1
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "5.0.0.beta3"
6
6
 
7
- gemspec :path => "../"
7
+ gemspec path: "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- uniqueness (0.7.0)
4
+ uniqueness (0.8.0)
5
5
  activerecord (>= 4.0.0)
6
6
  railties (>= 4.0.0)
7
7
 
@@ -160,4 +160,4 @@ DEPENDENCIES
160
160
  uniqueness!
161
161
 
162
162
  BUNDLED WITH
163
- 1.14.6
163
+ 1.16.1
@@ -34,6 +34,7 @@ module Uniqueness
34
34
  self.uniqueness_options[name] = Uniqueness.uniqueness_default_options.merge(options)
35
35
  before_validation :uniqueness_generate
36
36
  validate :uniqueness_validation
37
+ define_method("regenerate_#{name}") { update_attributes(name => Uniqueness.generate(self.uniqueness_options[name])) }
37
38
  end
38
39
  end
39
40
 
@@ -1,3 +1,3 @@
1
1
  module Uniqueness
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.9.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniqueness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar Abdel-Wahab
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2018-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  version: '0'
177
177
  requirements: []
178
178
  rubyforge_project:
179
- rubygems_version: 2.4.8
179
+ rubygems_version: 2.6.14
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: Adds unique attribute support to ActiveModel models.