5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 16:26:21 +00:00

feat: poder obtener el id desde un objeto

This commit is contained in:
f 2024-02-23 12:54:31 -03:00
parent 2c8dbc885c
commit e3aabf4b91
No known key found for this signature in database

View file

@ -18,6 +18,16 @@ class ActivityPub < ApplicationRecord
validates :object_id, presence: true validates :object_id, presence: true
validates :aasm_state, presence: true, inclusion: { in: %w[paused approved rejected reported removed] } validates :aasm_state, presence: true, inclusion: { in: %w[paused approved rejected reported removed] }
# Encuentra la URI de un objeto
#
# @return [String, nil]
def self.uri_from_object(object)
case object
when String then object
when Hash then object['id']
end
end
aasm do aasm do
# Todavía no hay una decisión sobre el objeto # Todavía no hay una decisión sobre el objeto
state :paused, initial: true state :paused, initial: true