about summary refs log tree commit diff stats
path: root/app/models/blog.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/blog.rb')
-rw-r--r--app/models/blog.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/blog.rb b/app/models/blog.rb index 415167c..b677e2b 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb
@@ -3,6 +3,8 @@ class Blog < ApplicationRecord
3 3
4 acts_as_taggable 4 acts_as_taggable
5 5
6 has_many :comments
7
6 validates :title, presence: true 8 validates :title, presence: true
7 validates :body, presence: true, if: :published 9 validates :body, presence: true, if: :published
8 validates :slug, presence: true, format: /\A[-a-z0-9]+\z/, if: :published 10 validates :slug, presence: true, format: /\A[-a-z0-9]+\z/, if: :published