Sha256: 933e65af9d79988c7a81686d492015f259c188e1e2ed99a427b10c9c44182614
Contents?: true
Size: 482 Bytes
Versions: 10
Compression:
Stored size: 482 Bytes
Contents
module Hyrax::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
10 entries across 10 versions & 2 rubygems