Skip to content

Commit

Permalink
Merge pull request #42 from enpitut2018/hinako
Browse files Browse the repository at this point in the history
Hinako
  • Loading branch information
wikemasa authored Nov 14, 2018
2 parents 1dbcbbf + 035c0b0 commit 963374c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ class Document < ApplicationRecord
belongs_to :user
belongs_to :template
validates :title, presence: true, length: { maximum: 50 }
validates :content, presence: true
#validates :scope, presence: true
end
5 changes: 5 additions & 0 deletions db/migrate/20181109155933_add_content_to_documents.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddContentToDocuments < ActiveRecord::Migration[5.2]
def change
add_column :documents, :content, :text
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2018_11_07_045416) do
ActiveRecord::Schema.define(version: 2018_11_09_155933) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -48,6 +48,7 @@
t.integer "scope"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "content"
t.index ["template_id"], name: "index_documents_on_template_id"
t.index ["user_id"], name: "index_documents_on_user_id"
end
Expand Down

0 comments on commit 963374c

Please sign in to comment.