Removed items and totos

This commit is contained in:
mcmac 2018-02-28 13:22:29 +00:00
parent 24924aa41d
commit 7551a03e6e
4 changed files with 0 additions and 31 deletions

View file

@ -1,5 +0,0 @@
class Item < ApplicationRecord
belongs_to :todo
validates_presence_of :name
end

View file

@ -1,5 +0,0 @@
class Todo < ApplicationRecord
has_many :items, dependent: :destroy
validates_presence_of :title, :created_by
end

View file

@ -1,10 +0,0 @@
class CreateTodos < ActiveRecord::Migration[5.1]
def change
create_table :todos do |t|
t.string :title
t.string :created_by
t.timestamps
end
end
end

View file

@ -1,11 +0,0 @@
class CreateItems < ActiveRecord::Migration[5.1]
def change
create_table :items do |t|
t.string :name
t.boolean :done
t.references :todo, foreign_key: true
t.timestamps
end
end
end