app/models/pulitzer/post.rb in pulitzer-0.5.5 vs app/models/pulitzer/post.rb in pulitzer-0.5.6
- old
+ new
@@ -1,9 +1,9 @@
module Pulitzer
class Post < ActiveRecord::Base
include ForeignOffice::Broadcaster if defined? ForeignOffice
extend ::FriendlyId
- has_many :versions
+ has_many :versions, dependent: :destroy
has_one :active_version, -> { active }, class_name: "Pulitzer::Version"
belongs_to :post_type
delegate :post_type_content_element_types, :free_form_section_types, :has_free_form_sections?, :has_templated_content_elements?, to: :post_type
delegate :post_tags, :content_elements, :content_element, :section, :has_label_type, :has_label, :post_tags_for, to: :active_version, allow_nil: true