[feat] Happening now JSON endpoint contains rendered abstract of event; Add corresponding tests

This commit is contained in:
Jimmy 2021-03-31 17:35:25 +08:00
parent 7b3d97fdbb
commit c3167a3503
3 changed files with 21 additions and 1 deletions

View file

@ -33,6 +33,8 @@
class Event < ApplicationRecord
include ActiveRecord::Transitions
include RevisionCount
include FormatHelper
has_paper_trail on: [:create, :update], ignore: [:updated_at, :guid, :week], meta: { conference_id: :conference_id }
acts_as_commentable
@ -337,6 +339,10 @@ class Event < ApplicationRecord
time <=> other.time
end
def serializable_hash(options = {})
super(options).merge('rendered_abstract' => markdown(abstract))
end
private
##