Skip to content

Commit

Permalink
MBS-12552: Move Entity role Linkable to Relatable (#2717)
Browse files Browse the repository at this point in the history
Linkable is used in entityHref.js only and in a way broader meaning,
whereas Relatable is used in a lot of files (including the very central
Constants.pm and entities.mjs) and in the same meaning as in this role:
“that can have relationships”.
  • Loading branch information
yvanzo authored Nov 8, 2022
1 parent 7a73902 commit f7d45e8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/MusicBrainz/Server/Entity/CoreEntity.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extends 'MusicBrainz::Server::Entity';
with 'MusicBrainz::Server::Entity::Role::Editable';
with 'MusicBrainz::Server::Entity::Role::GID';
with 'MusicBrainz::Server::Entity::Role::LastUpdate';
with 'MusicBrainz::Server::Entity::Role::Linkable';
with 'MusicBrainz::Server::Entity::Role::Relatable';
with 'MusicBrainz::Server::Entity::Role::Name';

__PACKAGE__->meta->make_immutable;
Expand Down
8 changes: 4 additions & 4 deletions lib/MusicBrainz/Server/Entity/Relationship.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ has 'entity0_id' => (

has 'entity0' => (
is => 'rw',
isa => 'Linkable',
isa => 'Relatable',
);

has 'entity0_credit' => (
Expand All @@ -57,7 +57,7 @@ has 'entity1_id' => (

has 'entity1' => (
is => 'rw',
isa => 'Linkable',
isa => 'Relatable',
);

has 'entity1_credit' => (
Expand Down Expand Up @@ -130,7 +130,7 @@ sub can_manually_reorder {

has source => (
is => 'rw',
isa => 'Linkable',
isa => 'Relatable',
);

has source_type => (
Expand All @@ -145,7 +145,7 @@ has source_credit => (

has target => (
is => 'rw',
isa => 'Linkable',
isa => 'Relatable',
);

has target_type => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package MusicBrainz::Server::Entity::Role::Linkable;
package MusicBrainz::Server::Entity::Role::Relatable;
use Moose::Role;

use List::AllUtils qw( partition_by sort_by );
Expand Down Expand Up @@ -132,7 +132,7 @@ around TO_JSON => sub {

=head1 NAME
MusicBrainz::Server::Entity::Role::Linkable
MusicBrainz::Server::Entity::Role::Relatable
=head1 ATTRIBUTES
Expand Down
4 changes: 2 additions & 2 deletions lib/MusicBrainz/Server/Entity/Types.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ subtype 'Edit'
subtype 'Entity'
=> as class_type 'MusicBrainz::Server::Entity';

subtype 'Linkable'
=> as role_type 'MusicBrainz::Server::Entity::Role::Linkable';
subtype 'Relatable'
=> as role_type 'MusicBrainz::Server::Entity::Role::Relatable';

1;

Expand Down

0 comments on commit f7d45e8

Please sign in to comment.