globalid 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of globalid might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/global_id/fixture_set.rb +13 -0
- data/lib/global_id/railtie.rb +5 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cfa513116ef143c878f8b6eefc242f9df668572c0ed3f3b4f5f5f87736e143f
|
4
|
+
data.tar.gz: 72e073ae2eec42a6038cda7bbf77bbeed3f72899eafe801bac1aca6c6bb24079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3527628dfa02f3099b1c4ac0f99260f9187d83702e2cca96fab261592466fba1caa82e3dc936a54660ac9c4c0a2da087ebdabfb0d21444928979dd5cc983a34
|
7
|
+
data.tar.gz: 460c643ca0f4d0a51dc9e218da9a891f05904d75e9106692d38a46fa7cc9ad1ace229e5bce37703e2f4e62aa049246628d61de9be444a32cd2a3e6a1452d0ff3
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class GlobalID
|
4
|
+
module FixtureSet
|
5
|
+
def signed_global_id(fixture_set_name, label, column_type: :integer, **options)
|
6
|
+
identifier = identify(label, column_type)
|
7
|
+
model_name = default_fixture_model_name(fixture_set_name)
|
8
|
+
uri = URI::GID.build([GlobalID.app, model_name, identifier, {}])
|
9
|
+
|
10
|
+
SignedGlobalID.new(uri, **options)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/global_id/railtie.rb
CHANGED
@@ -37,6 +37,11 @@ class GlobalID
|
|
37
37
|
require 'global_id/identification'
|
38
38
|
send :include, GlobalID::Identification
|
39
39
|
end
|
40
|
+
|
41
|
+
ActiveSupport.on_load(:active_record_fixture_set) do
|
42
|
+
require 'global_id/fixture_set'
|
43
|
+
send :extend, GlobalID::FixtureSet
|
44
|
+
end
|
40
45
|
end
|
41
46
|
end
|
42
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: globalid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- MIT-LICENSE
|
48
48
|
- README.md
|
49
49
|
- lib/global_id.rb
|
50
|
+
- lib/global_id/fixture_set.rb
|
50
51
|
- lib/global_id/global_id.rb
|
51
52
|
- lib/global_id/identification.rb
|
52
53
|
- lib/global_id/locator.rb
|
@@ -74,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
75
|
- !ruby/object:Gem::Version
|
75
76
|
version: '0'
|
76
77
|
requirements: []
|
77
|
-
rubygems_version: 3.2.
|
78
|
+
rubygems_version: 3.2.22
|
78
79
|
signing_key:
|
79
80
|
specification_version: 4
|
80
81
|
summary: 'Refer to any model with a URI: gid://app/class/id'
|