Sha256: db3bdcc8d52d2137ac82b747ce978e0027c54412a1e611882687a3756c3b0116
Contents?: true
Size: 1.04 KB
Versions: 16
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true namespace :resources do desc 'Fix curriculum metadata' task(fix_metadata: [:environment]) { ResourceTasks.fix_metadata } desc 'Generate Unit Document Bundles' task(generate_bundles: [:environment]) { ResourceTasks.generate_unit_bundles } desc 'Generate hierarchical positions for resources' task(generate_positions: [:environment]) { GenerateHierarchicalPositions.new.generate! } desc 'Generate slugs' task(generate_slugs: [:environment]) { Slug.generate_resources_slugs } desc 'Updates time to teach resources' task(update_time_to_teach: [:environment]) { ResourceTasks.update_time_to_teach } desc 'Sync reading assignment' task(sync_reading_assignments: [:environment]) { ResourceTasks.sync_reading_assignments } desc 'Clear detached/orphan resources' task clear_detached: :environment do rtype = Resource.resource_types[:resource] detached = Resource.where(tree: false, resource_type: rtype) puts "===> Removing #{detached.count} detached resources" detached.destroy_all end end
Version data entries
16 entries across 16 versions & 1 rubygems