Sha256: 8d703bd83b4f8ff81bf32d8945a3bef1a8c912a33969b36785c9d9141a02ce85
Contents?: true
Size: 482 Bytes
Versions: 8
Compression:
Stored size: 482 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.where(work_id: id).destroy_all 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
8 entries across 8 versions & 1 rubygems