Sha256: cb8400fa70592b5598c6ff9df264e522f13c6eacb3bb203b54f5e373c0b7325f
Contents?: true
Size: 476 Bytes
Versions: 4
Compression:
Stored size: 476 Bytes
Contents
module Sufia::Works module Featured extend ActiveSupport::Concern included do before_destroy :cleanup_featured_works after_save :check_featureability end def cleanup_featured_works FeaturedWork.destroy_all(work_id: id) end def check_featureability return unless private? cleanup_featured_works if featured? end def featured? return true if FeaturedWork.find_by_work_id(id) false end end end
Version data entries
4 entries across 4 versions & 1 rubygems