mirror of
https://github.com/System-End/highway.git
synced 2026-04-19 22:05:13 +00:00
mandate image on posts, update schema
This commit is contained in:
parent
b4e7464c07
commit
7f427c6be5
3 changed files with 2 additions and 6 deletions
|
|
@ -5,4 +5,5 @@ class Post < ApplicationRecord
|
|||
validates :description, presence: true
|
||||
validates :name, presence: true
|
||||
validates :hours, presence: true, numericality: { less_than_or_equal_to: 5, greater_than_or_equal_to: 0 }
|
||||
validates :featured_image, presence: true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
class AddUserIdToPosts < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_reference :posts, :user, null: false, foreign_key: true
|
||||
end
|
||||
end
|
||||
2
site/db/schema.rb
generated
2
site/db/schema.rb
generated
|
|
@ -54,7 +54,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_05_05_014600) do
|
|||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "hours"
|
||||
t.integer "user_id", null: false
|
||||
t.integer "user_id"
|
||||
t.index ["user_id"], name: "index_posts_on_user_id"
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue