Sha256: 57fce38755683bae0cefd1ec9026e4837de5f20a0d07146f6bf385a3c048c3bb
Contents?: true
Size: 518 Bytes
Versions: 9
Compression:
Stored size: 518 Bytes
Contents
# Copied from Curate module CurationConcern module WithGenericFiles extend ActiveSupport::Concern included do has_many :generic_files, property: :is_part_of, class_name: "Worthwhile::GenericFile" before_destroy :before_destroy_cleanup_generic_files end def before_destroy_cleanup_generic_files generic_files.each(&:destroy) end def copy_visibility_to_files generic_files.each do |gf| gf.visibility = visibility gf.save! end end end end
Version data entries
9 entries across 9 versions & 2 rubygems