-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' of github.com:Children-in-Families/oscar-web i…
…nto staging
- Loading branch information
Showing
3 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
class CaseNoteSerializer < ActiveModel::Serializer | ||
attributes :id, :attendee, :meeting_date, :interaction_type, :note, :client_id, :assessment_id, :case_note_domain_groups, :selected_domain_group_ids, :attachments, :draft, :created_at, :updated_at | ||
attributes :id, :attendee, :meeting_date, :interaction_type, :note, :client_id, :assessment_id, :case_note_domain_groups, | ||
:selected_domain_group_ids, :attachments, :draft, :tasks, :created_at, :updated_at | ||
|
||
|
||
private | ||
|
||
def case_note_domain_groups | ||
ActiveModel::ArraySerializer.new(object.case_note_domain_groups, each_serializer: CaseNoteDomainGroupSerializer) | ||
end | ||
|
||
def tasks | ||
tasks = Task.completed.where(case_note_id: object.id) | ||
[*object.tasks, *tasks] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters