uuid_attribute 0.9.8 → 0.9.10

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: 44593bb99af63c1047fa1f2e088395e723db8263abe9b8456b6a27a0504a435e
4
- data.tar.gz: cb68b8a4926951dd59636dfd78e3aa301833fe62143e7ffe01051048bfbcd6bf
3
+ metadata.gz: 4391aedd96215a7827897d233a988b61f8902abd5386ec56d9c242acf1541593
4
+ data.tar.gz: 9d62caede1fd48735913e6dfcdfe7bb4cbd36ef151ec4eb416c74f1cc6233b1b
5
5
  SHA512:
6
- metadata.gz: '0848b2ecd6ca98cb4bfbeab1fcb92cf3d73cf7e8323ca502379779ba374868ac0e88dc8356549e187f9908719030c2846aa6359ecb300b9afd8cd56356b44247'
7
- data.tar.gz: 93f0f9a5d1e4d086f5755fc0b343a53988e3c1c7110896e4858cb09726f978c693e577c9cfe74be1143eae1c8122cd3605c5a79aa03213d3a83ff5b697e06b33
6
+ metadata.gz: 9adf89495017230161cb481948f8096eb39f2e899c3b341ce6f6c81ff840e0ecdfb9358528ea8dc2cfcf2ae1e5941eb23c9bfe993270f02401e27790b73f605e
7
+ data.tar.gz: 3dba3afd0604bbb60eb6ceaf62fd0e0f547e5f966edf6be788b7da687a4657ead791afbb2bf9da64262ed8d1c5471b7c5af0b6a3b85c29e10ac870e0dcbefbe8
@@ -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
@@ -58,18 +65,18 @@ module UuidAttribute
58
65
  end
59
66
 
60
67
  config.to_prepare do
61
- unless ARGV.join(" ").include? "assets:"
62
- ActiveRecord::Type.register(:uuid, ::UuidAttribute::UUID)
68
+ ActiveRecord::Type.register(:uuid, ::UuidAttribute::UUID)
63
69
 
64
- ::UuidAttribute::Railtie::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, ActiveRecord::DatabaseConnectionError
79
+ Rails.logger.debug("Ignoring database on uuid init.")
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.8"
4
+ VERSION = "0.9.10"
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.8
4
+ version: 0.9.10
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-21 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel