Skip to content

Commit

Permalink
[F] Destroy text_created event when text is removed
Browse files Browse the repository at this point in the history
[Completes #374]
  • Loading branch information
SMaxOwok authored and zdavis committed Jun 3, 2017
1 parent c62dc2a commit da68e9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/app/models/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ class Text < ApplicationRecord
has_many :stylesheets
has_many :favorites, as: :favoritable
has_many :annotations, through: :text_sections
has_one :text_created_event,
class_name: Event,
as: :subject,
dependent: :destroy

# Delegations
delegate :creator_names_array, to: :project, prefix: true, allow_nil: true
Expand Down

0 comments on commit da68e9a

Please sign in to comment.