Files
fizzy/app/models/comment/promptable.rb
T
Mike Dalessio 2cb050af33 Missed a few changes in a rebase somewhere
This changeset now matches plan-b commit 609a0041
2025-11-17 09:19:46 -05:00

28 lines
611 B
Ruby

module Comment::Promptable
extend ActiveSupport::Concern
included do
include Rails.application.routes.url_helpers
end
def to_prompt
<<~PROMPT
BEGIN OF COMMENT #{id}
**Content:**
#{body.to_plain_text.first(5000)}
#### Metadata
* Id: #{id}
* Card id: #{card.number}
* Card title: #{card.title}
* Created by: #{creator.name}}
* Created at: #{created_at}}
* Path: #{card_path(card, anchor: ActionView::RecordIdentifier.dom_id(self), script_name: account.slug)}
END OF COMMENT #{id}
PROMPT
end
end