From e11dedec034c4180985adf4a9f176b07121f0a41 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 4 Jul 2018 11:46:13 -0400 Subject: Blog drafts no longer require slugs They do still technically require titles, but the engine will fill in "Untitled draft" if it is left blank. Unpublished posts can be viewed at a different URL than published posts would be. Quick links to view published and unpublished posts have been added to the admin panel. refs #1 --- db/migrate/20180704144707_unrequire_blog_slug.rb | 5 +++++ db/schema.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20180704144707_unrequire_blog_slug.rb (limited to 'db') diff --git a/db/migrate/20180704144707_unrequire_blog_slug.rb b/db/migrate/20180704144707_unrequire_blog_slug.rb new file mode 100644 index 0000000..e9444db --- /dev/null +++ b/db/migrate/20180704144707_unrequire_blog_slug.rb @@ -0,0 +1,5 @@ +class UnrequireBlogSlug < ActiveRecord::Migration[5.1] + def change + change_column_null :blogs, :slug, true + end +end diff --git a/db/schema.rb b/db/schema.rb index d885500..0279d8e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,12 +10,12 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180704125527) do +ActiveRecord::Schema.define(version: 20180704144707) do create_table "blogs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" do |t| t.string "title" t.text "body" - t.string "slug", null: false + t.string "slug" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.boolean "published", default: false, null: false -- cgit 1.4.1