1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Rename ActivityPubPayloadGeneration to ActivityPub::Identifier

This commit is contained in:
Matt Jankowski 2024-05-22 10:56:52 -04:00
parent 4f51ee0934
commit bfb205c0a4
5 changed files with 24 additions and 22 deletions

View file

@ -13,7 +13,7 @@
# #
class Block < ApplicationRecord class Block < ApplicationRecord
include ActivityPubPayloadGeneration include ActivityPub::Identifier
include Paginable include Paginable
include RelationshipCacheable include RelationshipCacheable

View file

@ -0,0 +1,21 @@
# frozen_string_literal: true
module ActivityPub
module Identifier
extend ActiveSupport::Concern
included do
before_validation :generate_global_identifier,
only: :create,
unless: :uri?
end
private
def generate_global_identifier
self.uri = ActivityPub::TagManager
.instance
.generate_activity_uri
end
end
end

View file

@ -1,19 +0,0 @@
# frozen_string_literal: true
module ActivityPubPayloadGeneration
extend ActiveSupport::Concern
included do
before_validation :generate_payload_uri,
only: :create,
unless: :uri?
end
private
def generate_payload_uri
self.uri = ActivityPub::TagManager
.instance
.generate_activity_uri
end
end

View file

@ -16,7 +16,7 @@
# #
class Follow < ApplicationRecord class Follow < ApplicationRecord
include ActivityPubPayloadGeneration include ActivityPub::Identifier
include Paginable include Paginable
include RelationshipCacheable include RelationshipCacheable
include RateLimitable include RateLimitable

View file

@ -16,7 +16,7 @@
# #
class FollowRequest < ApplicationRecord class FollowRequest < ApplicationRecord
include ActivityPubPayloadGeneration include ActivityPub::Identifier
include Paginable include Paginable
include RelationshipCacheable include RelationshipCacheable
include RateLimitable include RateLimitable