|
2 | 2 |
|
3 | 3 | class GlobalID
|
4 | 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, {}]) |
| 5 | + def global_id(fixture_set_name, label, column_type: :integer, **options) |
| 6 | + create_global_id(fixture_set_name, label, column_type: column_type, klass: GlobalID, **options) |
| 7 | + end |
9 | 8 |
|
10 |
| - SignedGlobalID.new(uri, **options) |
| 9 | + def signed_global_id(fixture_set_name, label, column_type: :integer, **options) |
| 10 | + create_global_id(fixture_set_name, label, column_type: column_type, klass: SignedGlobalID, **options) |
11 | 11 | end
|
| 12 | + |
| 13 | + private |
| 14 | + def create_global_id(fixture_set_name, label, klass:, column_type: :integer, **options) |
| 15 | + identifier = identify(label, column_type) |
| 16 | + model_name = default_fixture_model_name(fixture_set_name) |
| 17 | + uri = URI::GID.build([GlobalID.app, model_name, identifier, {}]) |
| 18 | + klass.new(uri, **options) |
| 19 | + end |
12 | 20 | end
|
13 | 21 | end
|
0 commit comments