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

Álax Alves gitlab at mg.gitlab.com
Fri Nov 16 21:33:24 BRST 2018


Álax Alves started a new 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

@diguliu Do you think its needed to keep the uploaded_file even after its associated profile is deleted? If not I'll change this to `dependent: :destroy`.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1644#note_117952891
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/20181116/ed8da334/attachment-0001.html>


More information about the Noosfero-dev mailing list