diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-12 17:10:34 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-12 17:10:34 -0400 |
commit | 835af696703484208882a70cc5dd47c5838ecf58 (patch) | |
tree | 8174d5b8c6f2486da56569bad361dd10aa1183f8 /app/models/blog.rb | |
parent | b24e6f58a525fc576e23ef9d498745e64c16cd6c (diff) | |
download | thoughts-835af696703484208882a70cc5dd47c5838ecf58.tar.gz thoughts-835af696703484208882a70cc5dd47c5838ecf58.tar.bz2 thoughts-835af696703484208882a70cc5dd47c5838ecf58.zip |
Added blog post commenting
Diffstat (limited to 'app/models/blog.rb')
-rw-r--r-- | app/models/blog.rb | 2 |
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 |