wolf_core 1.0.107 → 1.0.108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2b47193c6304179d368dfd1c8b5c055945cbca7799b82636bf59b9f5bb3ff7a
4
- data.tar.gz: e59d73bb47efdc0559547c589b47baf7024305531e782cfe94c0cc21c3e57bd8
3
+ metadata.gz: b982ed79eca33411bc8e32e77ab7ffbbc000b6800eea93d06060fa09f5af5f5c
4
+ data.tar.gz: 446e0e76c9cfd4d799b346bbe819cc7fbc9e0a8cb6c3c1f3610dd88c40af9189
5
5
  SHA512:
6
- metadata.gz: 36d2c14e23e2eba23a43f672b26c717bfe05c314d91847da6304521195bbccc4e7fb10fbd855b250a84f2abb3deaf21a68ea7dd9c31d75600ae069d8531f5346
7
- data.tar.gz: 9eccdaa7155ae761c69db5d1df9cff8068db43593b74002176b881dc4a59bf48464a6cbe7997e76ff5ad4ea7c50aa3853647ce82216437614d328b8a88e25493
6
+ metadata.gz: 553d5143443970552b9c3192f668d4acfe910fbc0e9c52744ff1e0a7e3e3b68d877d7ba66edfc1acd49cb1b523ee6f9f57a91940f8eeabaa8687ac89040c438f
7
+ data.tar.gz: f393f44badf1cd7c918de8035308ddf6abf8f4f3743bb87cdf9ef942a33299ce6b5918aac9e5b9288e420585e3aa115ceb2b286c1252edc43ed9d71b012c15f3
@@ -5,7 +5,7 @@ module WolfCore
5
5
  define_attributes :id
6
6
  validates :id, presence: true
7
7
 
8
- after_initialize do
8
+ before_initialize do
9
9
  @id ||= generate_id
10
10
  end
11
11
 
@@ -23,10 +23,14 @@ module WolfCore
23
23
  private
24
24
 
25
25
  def generate_id
26
- prefix = self.class.to_s.underscore.split('/').last.downcase[0..4]
26
+ prefix = generate_id_prefix
27
27
  timestamp = Time.now.utc.to_i
28
28
  uuid = SecureRandom.uuid.delete('-')[0..9]
29
29
  "#{prefix}-#{timestamp}-#{uuid}"
30
30
  end
31
+
32
+ def generate_id_prefix
33
+ self.class.to_s.underscore.split('/').last.downcase[0..4]
34
+ end
31
35
  end
32
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.107"
4
+ VERSION = "1.0.108"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.107
4
+ version: 1.0.108
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo