app/models/pulitzer/post.rb in pulitzer-0.1.7 vs app/models/pulitzer/post.rb in pulitzer-0.1.8
- old
+ new
@@ -6,9 +6,11 @@
delegate :post_type_content_element_types, to: :post_type
delegate :content_elements, :post_tags, to: :active_version, allow_nil: true
friendly_id :title, use: [:slugged, :finders]
after_create :create_preview_version
+ validates :title, presence: true
+
TAG_MODELS = ["Pulitzer::Tag"] + Pulitzer.tagging_models
def content_element(label)
self.content_elements.find_by(label: label)
end