uniq_identifier 0.0.3 → 0.0.4

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: 4a359694ccee8dd0618258f49bf4636b420d97c1
4
- data.tar.gz: 1bf3f348682d815b16048969209c9ad124c4a2c1
3
+ metadata.gz: a6f678939241bfd79c27206043c3b38e5648f62e
4
+ data.tar.gz: 72c0accd976c83691a8e334544248fb0e3ed62bc
5
5
  SHA512:
6
- metadata.gz: ab4422445fff7e442bf0465613c27eb5bec83d84b685f0f93a02405cafe41899e44fb132c39e5f6b9c535d0f70d4b774ae6bf7cbb3b1dd1ca4ef08c3e0b0133e
7
- data.tar.gz: a640c32e7e162e5a3f2253f20f5d0d7a3ec2bca3d1ee2364da4defe25a147361ad528ced7e9b19563744cdd77b925cf9e0855b1566cb5d7236787930cfe1cdf5
6
+ metadata.gz: 295c8d6342cd8245aa181a6554bd2dc67423db8b47c063c9a3b9da3010de76be646665a770b0a521957ee1f80616a3c34ecea4d8a926fb9aa82468baa7e951ff
7
+ data.tar.gz: 99e228f69121f1869745e48420111f3cef260d7a8b74d33d3e0f0c42a49fa1cd224958d13d669b71d41ca2b4eaa409a60ab3deaf6256a138b415ae43a4959fd3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### VERSION 0.0.4
2
+
3
+ * Enhancements
4
+ * don't override settled uuid and make sure model have uuid field
5
+ * for avoid manual attempts to set uuid at nil
6
+
1
7
  ### VERSION 0.0.3
2
8
 
3
9
  * Bug Fix
@@ -8,7 +8,11 @@ module UniqIdentifier
8
8
  end
9
9
 
10
10
  def set_uniq_identifier
11
- self.send(:uuid=, UniqIdentifier.configuration.generator.uuid)
11
+ if self.respond_to?(:uuid)
12
+ unless self.uuid?
13
+ self.send(:uuid=, UniqIdentifier.configuration.generator.uuid)
14
+ end
15
+ end
12
16
  end
13
17
  end
14
18
  end
@@ -1,3 +1,3 @@
1
1
  module UniqIdentifier
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -9,5 +9,6 @@ module UniqIdentifier
9
9
  def uniq_identifier
10
10
  include Hook
11
11
  after_initialize :set_uniq_identifier
12
+ after_validation :set_uniq_identifier # Case of manual attempt to do a nil assignation
12
13
  end
13
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniq_identifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel AZEMAR
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-25 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.4.1
88
+ rubygems_version: 2.4.6
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: Add an uniq identifier