Skip to content

Commit

Permalink
Update Controller and routing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ErinClaudio committed Jun 26, 2024
1 parent 2ea43d9 commit 1d07748
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 81 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# == Schema Information
#
# Table name: default_pet_tasks
# Table name: task_templates
#
# id :bigint not null, primary key
# description :string
Expand All @@ -13,15 +13,17 @@
#
# Indexes
#
# index_default_pet_tasks_on_organization_id (organization_id)
# index_task_templates_on_organization_id (organization_id)
#
# Foreign Keys
#
# fk_rails_... (organization_id => organizations.id)
#
class DefaultPetTask < ApplicationRecord
acts_as_tenant(:organization)
module Checklist
class TaskTemplate < ApplicationRecord
acts_as_tenant(:organization)

validates :name, presence: true
validates_numericality_of :due_in_days, only_integer: true, greater_than_or_equal_to: 0, allow_nil: true
validates :name, presence: true
validates_numericality_of :due_in_days, only_integer: true, greater_than_or_equal_to: 0, allow_nil: true
end
end
4 changes: 3 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
post "attach_files", on: :member, to: "pets#attach_files"
end

resources :default_pet_tasks
namespace :checklist do
resources :task_templates
end
resources :faqs
resources :dashboard, only: [:index] do
collection do
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RenameDefaultPetTasksToTaskTemplates < ActiveRecord::Migration[7.1]
def change
rename_table :default_pet_tasks, :task_templates
end
end
26 changes: 13 additions & 13 deletions db/schema.rb

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

0 comments on commit 1d07748

Please sign in to comment.