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 +4 -4
- data/README.md +2 -0
- data/gemfiles/40.gemfile +1 -1
- data/gemfiles/40.gemfile.lock +2 -2
- data/gemfiles/41.gemfile +1 -1
- data/gemfiles/41.gemfile.lock +2 -2
- data/gemfiles/42.gemfile +1 -1
- data/gemfiles/42.gemfile.lock +2 -2
- data/gemfiles/50.gemfile +1 -1
- data/gemfiles/50.gemfile.lock +2 -2
- data/lib/uniqueness/model.rb +1 -0
- data/lib/uniqueness/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9753b7791871ec9245ee7be5b676e6d00ac2d31e
|
4
|
+
data.tar.gz: 2aed1250dbe66bcf7f05b5f7e57f763d8a0a7a67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/gemfiles/40.gemfile
CHANGED
data/gemfiles/40.gemfile.lock
CHANGED
data/gemfiles/41.gemfile
CHANGED
data/gemfiles/41.gemfile.lock
CHANGED
data/gemfiles/42.gemfile
CHANGED
data/gemfiles/42.gemfile.lock
CHANGED
data/gemfiles/50.gemfile
CHANGED
data/gemfiles/50.gemfile.lock
CHANGED
data/lib/uniqueness/model.rb
CHANGED
@@ -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
|
|
data/lib/uniqueness/version.rb
CHANGED
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.
|
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:
|
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.
|
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.
|