Class: Actions::Katello::OrphanCleanup::RemoveOrphanedContentUnits
- Inherits:
-
Base
- Object
- Base
- Actions::Katello::OrphanCleanup::RemoveOrphanedContentUnits
- Defined in:
- app/lib/actions/katello/orphan_cleanup/remove_orphaned_content_units.rb
Instance Method Summary collapse
Instance Method Details
#rescue_strategy ⇒ Object
16 17 18 |
# File 'app/lib/actions/katello/orphan_cleanup/remove_orphaned_content_units.rb', line 16 def rescue_strategy Dynflow::Action::Rescue::Skip end |
#run ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'app/lib/actions/katello/orphan_cleanup/remove_orphaned_content_units.rb', line 5 def run models = [] ::Katello::RepositoryTypeManager.enabled_repository_types.each_value do |repo_type| models << repo_type.content_types_to_index end models.flatten.each do |content_type| content_type.model_class.orphaned.destroy_all end end |