From d7dbb6519629db02447d95237ef7e8f6aa84d10a Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 16 Oct 2023 10:10:29 -0400 Subject: Added ActiveStorage (but I'm not using it yet) --- app/models/blog.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/models') diff --git a/app/models/blog.rb b/app/models/blog.rb index e43990e..362f69f 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -11,6 +11,8 @@ class Blog < ApplicationRecord validates :slug, presence: true, format: /\A[-a-z0-9]+\z/, if: :published validates :user, presence: true + has_many_attached :images + before_validation :set_draft_title before_save :set_published_at -- cgit 1.4.1