Merge remote-tracking branch 'parent/main' into upstream-20240628
This commit is contained in:
commit
6955843321
178 changed files with 1924 additions and 1178 deletions
|
@ -128,6 +128,22 @@ class PreviewCard < ApplicationRecord
|
|||
@history ||= Trends::History.new('links', id)
|
||||
end
|
||||
|
||||
def authors
|
||||
@authors ||= [PreviewCard::Author.new(self)]
|
||||
end
|
||||
|
||||
class Author < ActiveModelSerializers::Model
|
||||
attributes :name, :url, :account
|
||||
|
||||
def initialize(preview_card)
|
||||
super(
|
||||
name: preview_card.author_name,
|
||||
url: preview_card.author_url,
|
||||
account: preview_card.author_account,
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
class << self
|
||||
private
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue