mirror of https://github.com/mastodon/mastodon
20 lines
390 B
Ruby
20 lines
390 B
Ruby
# 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_uri_for(self)
|
|
end
|
|
end
|