Sha256: c74ab0505b64a4899a57524825e69ba4012b0928d5dde46491f909fbd671416f

Contents?: true

Size: 268 Bytes

Versions: 8

Compression:

Stored size: 268 Bytes

Contents

module Sufia
  module GenericFile
    module Trophies
      extend ActiveSupport::Concern
      included do
        before_destroy :cleanup_trophies
      end

      def cleanup_trophies
        Trophy.destroy_all(generic_file_id: self.id)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
sufia-models-6.2.0 app/models/concerns/sufia/generic_file/trophies.rb
sufia-models-6.1.0 app/models/concerns/sufia/generic_file/trophies.rb
sufia-models-6.0.0 app/models/concerns/sufia/generic_file/trophies.rb
sufia-6.0.0 sufia-models/app/models/concerns/sufia/generic_file/trophies.rb
sufia-6.0.0.rc4 sufia-models/app/models/concerns/sufia/generic_file/trophies.rb
sufia-models-6.0.0.rc4 app/models/concerns/sufia/generic_file/trophies.rb
sufia-6.0.0.rc3 sufia-models/app/models/concerns/sufia/generic_file/trophies.rb
sufia-models-6.0.0.rc3 app/models/concerns/sufia/generic_file/trophies.rb