acts_as_uuid 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,11 @@
1
1
  module ActsAsUUID
2
2
  def self.included klass
3
- klass.before_create :generate_uuid
3
+ klass.before_validation :generate_uuid
4
4
  klass.validates :id, :uniqueness => true
5
5
  klass.primary_key = :id
6
6
  end
7
7
 
8
8
  def generate_uuid
9
- self.id = UUID.generate
9
+ self.id ||= UUID.generate
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module ActsAsUuid
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_uuid
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cristiano Betta