noosfero | Deleting associated uploaded_file when profile is deleted (!1644)

Rodrigo Souto gitlab at mg.gitlab.com
Mon Dec 3 10:05:30 BRST 2018


Rodrigo Souto commented on a discussion on app/models/profile.rb:

>    has_many :articles, :dependent => :destroy
>    belongs_to :home_page, :class_name => Article.name, :foreign_key => 'home_page_id'
>  
> -  has_many :files, :class_name => 'UploadedFile'
> +  has_many :files, class_name: 'UploadedFile', dependent: :delete_all

Yes, I think we should remove the Uploaded File when the profile is removed. We should use `delete` instead of `delete` to ensure the triggers are ran properly.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1644#note_121828354
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20181203/51072ab7/attachment.html>


More information about the Noosfero-dev mailing list