Skip to content

Commit

Permalink
Merge pull request #22 from ScottGarman/generate-task-category-model
Browse files Browse the repository at this point in the history
Generate Task Category model
  • Loading branch information
ScottGarman authored Dec 31, 2024
2 parents 5837f16 + 589397f commit 2f51795
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/models/task_category.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class TaskCategory < ApplicationRecord
belongs_to :user
end
10 changes: 10 additions & 0 deletions db/migrate/20241231041017_create_task_categories.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateTaskCategories < ActiveRecord::Migration[8.0]
def change
create_table :task_categories do |t|
t.string :name, null: false
t.references :user, null: false, foreign_key: true

t.timestamps
end
end
end
11 changes: 10 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions test/fixtures/task_categories.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

donpdonp:
name: Cafe Exploration
user: donpdonp

leofsiege:
name: Home Projects
user: leofsiege
7 changes: 7 additions & 0 deletions test/models/task_category_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "test_helper"

class TaskCategoryTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit 2f51795

Please sign in to comment.