Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTSKF-1002 - CCCD - Task to copy message attachment (singular) to attachments (plural) #7990

Merged
merged 6 commits into from
Jan 16, 2025

Conversation

VinceChiuMOJ
Copy link
Contributor

What

  1. Add a new has_many_attached :attachments to the Message model alongside the existing has_one_attached :attachment
  2. Add a after_create callback in the Message model to attach an attachment, if it exists, to attachments.
  3. Create and run a Rake task to attach attachments on existing messages to attachments.

Ticket

https://dsdmoj.atlassian.net/browse/CTSKF-1002

message.rb:
Added attachments
Added duplicate_message_attachment in after_create
doocument.rake:
rake task to duplicate message attachment
@VinceChiuMOJ VinceChiuMOJ requested review from a team as code owners December 31, 2024 12:09
fix rubocop test on coding style
fix rsepc test on message #destroy
Copy link
Contributor

@jrmhaig jrmhaig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK. In spec/models/message_spec.rb there is a test for attachment. This will need ultimately to be replaced by a similar one for attachments, and it could go in alongside it now.

it { is_expected.to have_one_attached(:attachment) }

app/models/message.rb Outdated Show resolved Hide resolved
VinceChiuMOJ and others added 4 commits December 31, 2024 16:39
Co-authored-by: Joseph Haig <jrmhaig@users.noreply.github.com>
Remove redundant checking.
added count_blob_map
Copy link
Contributor

@AlexRyanShep AlexRyanShep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@VinceChiuMOJ VinceChiuMOJ merged commit 040967b into master Jan 16, 2025
20 of 21 checks passed
@VinceChiuMOJ VinceChiuMOJ deleted the CTSKF-1002 branch January 16, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants