added Project model with project_name and Task model with title&status
This commit is contained in:
2
app/models/project.rb
Normal file
2
app/models/project.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class Project < ApplicationRecord
|
||||
end
|
||||
2
app/models/task.rb
Normal file
2
app/models/task.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class Task < ApplicationRecord
|
||||
end
|
||||
9
db/migrate/20260126072711_create_projects.rb
Normal file
9
db/migrate/20260126072711_create_projects.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class CreateProjects < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :projects do |t|
|
||||
t.string :project_name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
10
db/migrate/20260126072814_create_tasks.rb
Normal file
10
db/migrate/20260126072814_create_tasks.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateTasks < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :tasks do |t|
|
||||
t.string :title
|
||||
t.string :status
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
7
test/fixtures/projects.yml
vendored
Normal file
7
test/fixtures/projects.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
project_name: MyString
|
||||
|
||||
two:
|
||||
project_name: MyString
|
||||
9
test/fixtures/tasks.yml
vendored
Normal file
9
test/fixtures/tasks.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
title: MyString
|
||||
status: MyString
|
||||
|
||||
two:
|
||||
title: MyString
|
||||
status: MyString
|
||||
7
test/models/project_test.rb
Normal file
7
test/models/project_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require "test_helper"
|
||||
|
||||
class ProjectTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
7
test/models/task_test.rb
Normal file
7
test/models/task_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require "test_helper"
|
||||
|
||||
class TaskTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
Reference in New Issue
Block a user