with_uuid 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/with_uuid/model.rb +9 -2
- data/lib/with_uuid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7878dbaad2b0bbd3a7658d19a75b3980c37033c1
|
4
|
+
data.tar.gz: a693d102d2cbcda7f3a78e8c1ec13b4b137c2bc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00bde0fd1b19e78be43e9a504d6d2492139d40ba546b96c45c1eb9850eaff85fc6659b2a7da40dcb53e8f110b59c8fd61b33dcecbfbfd87754d30c759cbc3af0
|
7
|
+
data.tar.gz: 9db2e2034d75d8232e3501c9b9d5fd7057b19964f3c876a733bf73a21fd4131681f4a5d7eede0d37962df85b94775217d3b14b49850690dc7e3d8d2d4951569e
|
data/lib/with_uuid/model.rb
CHANGED
@@ -14,12 +14,19 @@ module WithUuid
|
|
14
14
|
|
15
15
|
end
|
16
16
|
|
17
|
+
protected
|
18
|
+
|
17
19
|
def set_id
|
18
20
|
return unless id.blank?
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
+
uuid = WithUuid::CombUuid.uuid.to_s
|
23
|
+
before_set_id( uuid )
|
24
|
+
write_attribute( :id, uuid )
|
25
|
+
after_set_id( uuid )
|
22
26
|
end
|
23
27
|
|
28
|
+
def before_set_id( uuid ); end
|
29
|
+
def after_set_id( uuid ); end
|
30
|
+
|
24
31
|
end
|
25
32
|
end
|
data/lib/with_uuid/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: with_uuid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Harrelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|