uuid_attribute 0.9.7 → 0.9.9

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: 2736532308bf26cddc0ee5de27887ae6ee98237839c6be46c80cffb7e149f8bf
4
- data.tar.gz: 41bc4956385673c2f3ce903756f43cd67a57eed09f96b32f4ff113ad397907f2
3
+ metadata.gz: 2e7cafb880373c62806722565e7f6a25837726631130fa4c2cdd406238414148
4
+ data.tar.gz: f1efb6a4d5406b2090240fe20d5eddc43867f6d1c60615824e5cfa0749c4955e
5
5
  SHA512:
6
- metadata.gz: 7f573a3bae26daecabed457303913df3cd6bf60230b80bfcb3f741613d2e84a4578fe34215845b3cbb07dc646a4859fd724a1bc293e278a5cf84b39ee826ceaf
7
- data.tar.gz: 935940cc5696eab4f3d36c4cbed3bc348a5f1758bf89094ea78928d66a558309bf8ca760a6fa945c15488a83321b2d1752a593162d132141c97b8ea9d9f05057
6
+ metadata.gz: 0b98f218c8fa2ef6dd5a8dbacf5fbaf7d61170518a499c8e2eba599565aab02eae3076bd7608a4e005817f44bec7bd2adbebbe83e95a7bc049dcfbce6c7866b8
7
+ data.tar.gz: 81cb250855682c73830b85c8efb3cff927d9514d45685f154bfdba4bb8218d30916a7d954de7e3742bb9f22d20e9fd11feebd3db6ddb83441608b250340ddd6f
@@ -32,6 +32,13 @@ module UuidAttribute
32
32
 
33
33
  models -= %w[ActiveRecord Concern]
34
34
 
35
+ begin
36
+ ActiveStorage::VariantRecord.new
37
+ ActiveStorage::Attachment.new
38
+ ActiveStorage::Blob.new
39
+ rescue
40
+ end
41
+
35
42
  models.each(&:constantize)
36
43
  all_active_record_classes
37
44
  end
@@ -57,19 +64,19 @@ module UuidAttribute
57
64
  end
58
65
  end
59
66
 
60
- config.after_initialize do
61
- unless ARGV.join(" ").include? "assets:"
62
- ActiveRecord::Type.register(:uuid, ::UuidAttribute::UUID)
67
+ config.to_prepare do
68
+ ActiveRecord::Type.register(:uuid, ::UuidAttribute::UUID)
63
69
 
64
- configure_binary_ids if UuidAttribute.auto_detect_binary_ids
70
+ ::UuidAttribute::Railtie::configure_binary_ids if UuidAttribute.auto_detect_binary_ids
65
71
 
66
- if UuidAttribute.default_primary_id
67
- # Configure UUID as Default Primary Key
68
- Rails&.application&.config&.generators do |g|
69
- g.orm :active_record, primary_key_type: "binary, limit: 16"
70
- end
72
+ if UuidAttribute.default_primary_id
73
+ # Configure UUID as Default Primary Key
74
+ Rails&.application&.config&.generators do |g|
75
+ g.orm :active_record, primary_key_type: "binary, limit: 16"
71
76
  end
72
77
  end
78
+ rescue ActiveRecord::StatementInvalid => e
79
+ Rails.logger.info("Database doesn't exist yet.")
73
80
  end
74
81
  end
75
82
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UuidAttribute
4
- VERSION = "0.9.7"
4
+ VERSION = "0.9.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uuid_attribute
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Negri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-20 00:00:00.000000000 Z
11
+ date: 2023-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel