diff --git a/app/models/casa_case.rb b/app/models/casa_case.rb index 5b8d20e315..6dc84b9c00 100644 --- a/app/models/casa_case.rb +++ b/app/models/casa_case.rb @@ -4,6 +4,7 @@ class CasaCase < ApplicationRecord has_many :case_assignments, dependent: :destroy has_many(:volunteers, through: :case_assignments, source: :volunteer, class_name: "User") has_many :case_contacts, dependent: :destroy + has_many :past_court_dates, dependent: :destroy validates :case_number, uniqueness: {case_sensitive: false}, presence: true belongs_to :hearing_type, optional: true belongs_to :judge, optional: true diff --git a/app/models/past_court_date.rb b/app/models/past_court_date.rb new file mode 100644 index 0000000000..bb81b2283b --- /dev/null +++ b/app/models/past_court_date.rb @@ -0,0 +1,22 @@ +class PastCourtDate < ApplicationRecord + belongs_to :casa_case +end + +# == Schema Information +# +# Table name: past_court_dates +# +# id :bigint not null, primary key +# date :datetime not null +# created_at :datetime not null +# updated_at :datetime not null +# casa_case_id :bigint not null +# +# Indexes +# +# index_past_court_dates_on_casa_case_id (casa_case_id) +# +# Foreign Keys +# +# fk_rails_... (casa_case_id => casa_cases.id) +# diff --git a/app/views/casa_cases/edit.html.erb b/app/views/casa_cases/edit.html.erb index e5dce293b3..72ed68470b 100644 --- a/app/views/casa_cases/edit.html.erb +++ b/app/views/casa_cases/edit.html.erb @@ -7,6 +7,21 @@ <%= render 'form', casa_case: @casa_case %> <% end %> +
<%= pcd.date.strftime("%B %e, %Y") %>
+ <% end %> +