Removed items and totos
This commit is contained in:
parent
24924aa41d
commit
7551a03e6e
4 changed files with 0 additions and 31 deletions
|
|
@ -1,5 +0,0 @@
|
|||
class Item < ApplicationRecord
|
||||
belongs_to :todo
|
||||
|
||||
validates_presence_of :name
|
||||
end
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
class Todo < ApplicationRecord
|
||||
has_many :items, dependent: :destroy
|
||||
|
||||
validates_presence_of :title, :created_by
|
||||
end
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue