5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-25 14:16:22 +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 :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
# Todavía no hay una decisión sobre el objeto
state :paused, initial: true