bullet_train-has_uuid 1.0.1 → 1.0.2

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
  SHA256:
3
- metadata.gz: 52c11697fa020290e6e62935d2cc9f691065b27adbbc2cf1c6839e0389a88376
4
- data.tar.gz: fa48b9eda6c498576384df68ad505b0984ec8827f33025fe6289c90c1b052396
3
+ metadata.gz: dbc4cba4c7e84ece751dac2ee38ce86ca4438df9ef24921d257ded95b3d80f54
4
+ data.tar.gz: 045a2a820e74da6986b176fa297747b4597106948853bf88cc8d14d7769e7db0
5
5
  SHA512:
6
- metadata.gz: 1cad7a7d1da969cc6cfadb5bf4a79a9e4e617c9edc59798955774e9697f8895f90a5e92b12a7001aee3dff3a6e8606a6c6d0ca0a331ca647c8c5372e116e28b3
7
- data.tar.gz: 383cd0261002e7314bc7d9892783cfe3af950c6bb695f80b1ec0ff7a6fe4ec4e97df91e6daf61e2ab430efb8a718ec8e3b2d2df1e370109f8a64d3bd182d2402
6
+ metadata.gz: 52520c5e6de74da7cacb26561576ef2584d6c1acbe5b259bce83f89c1b2a23d29108eeb59bec2db08ed0fed8c6abb511dffe8dbb7ac69eac5913705d6fe49875
7
+ data.tar.gz: 339325f15245bd1cb6435d972015fb0598b1a53c13528e164b233c2fff72f2b397e6168e79e79e52dcfb38e2093d890dd6e5e60bbfab656a5aae96c5ac371f32
@@ -0,0 +1,21 @@
1
+ module HasUuid
2
+ extend ActiveSupport::Concern
3
+
4
+ # define relationships.
5
+ included do
6
+ after_initialize do
7
+ self.uuid ||= SecureRandom.hex
8
+ end
9
+ end
10
+
11
+ # define class methods.
12
+ module ClassMethods
13
+ end
14
+
15
+ # define object methods.
16
+ def short_uuid
17
+ self.uuid.first(7)
18
+ rescue
19
+ "nil"
20
+ end
21
+ end
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module HasUuid
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-has_uuid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver