Module: Hyrax::Works::Featured

Extended by:
ActiveSupport::Concern
Included in:
Hyrax::WorkBehavior
Defined in:
app/models/concerns/hyrax/works/featured.rb

Instance Method Summary collapse

Instance Method Details

#check_featureabilityObject



13
14
15
16
# File 'app/models/concerns/hyrax/works/featured.rb', line 13

def check_featureability
  return unless private?
  cleanup_featured_works if featured?
end


9
10
11
# File 'app/models/concerns/hyrax/works/featured.rb', line 9

def cleanup_featured_works
  FeaturedWork.where(work_id: id).destroy_all
end

#featured?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'app/models/concerns/hyrax/works/featured.rb', line 18

def featured?
  return true if FeaturedWork.find_by_work_id(id)
  false
end