From 7640f27b9e183c6e9a00249c352e3515d3f90c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 2 Mar 2021 00:10:03 +0100 Subject: Rename db directory to models --- db/comment.rb | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 db/comment.rb (limited to 'db/comment.rb') diff --git a/db/comment.rb b/db/comment.rb deleted file mode 100644 index b3977f6..0000000 --- a/db/comment.rb +++ /dev/null @@ -1,20 +0,0 @@ -class Comment < ActiveRecord::Base - belongs_to :post - validates_presence_of :date - validates_presence_of :author - validates_presence_of :email - validates_format_of :email, with: /@/ - validates_presence_of :body -end - -class CreateCommentTable < ActiveRecord::Migration[6.0] - def change - create_table :comments do |t| - t.references :post, foreign_key: true, index: true - t.string :author, null: false - t.string :email, null: false - t.string :body, null: false - t.timestamps - end - end -end -- cgit v1.2.3