since it's a transitive association it can not be deleted through a dependent: :delete_all
I tried changing it to a direct association through sender_id, but this caused problems as the original messages includes not only sent messages, but received ones too.
I ended up transfering them to deleted user too instead of deleting them just on the off chance that they could be of use once we redo classroom.
Apparently the rails version we're using right now's ActiveSupport::Concern does not include prepended helpers yet, so I had to define WithDeletedUser with the more traditional syntax.
:dart: Goal
Allow properly deleting users.
:memo: Details
direct_messages
association gave me some trouble:dependent: :delete_all
sender_id
, but this caused problems as the originalmessages
includes not only sent messages, but received ones too.Apparently the rails version we're using right now's
ActiveSupport::Concern
does not include prepended helpers yet, so I had to defineWithDeletedUser
with the more traditional syntax.:warning: Dependencies
None.
:back: Backwards compatibility
Requires updates on apps too.
:soon: Future work
Fix tests.