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:
parent
2c8dbc885c
commit
e3aabf4b91
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue