[feat] Happening now JSON endpoint contains rendered abstract of event; Add corresponding tests
This commit is contained in:
parent
7b3d97fdbb
commit
c3167a3503
3 changed files with 21 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue