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

Version Path
lcms-engine-0.5.5 lib/tasks/resources.rake
lcms-engine-0.5.4 lib/tasks/resources.rake
lcms-engine-0.5.3 lib/tasks/resources.rake
lcms-engine-0.5.2 lib/tasks/resources.rake
lcms-engine-0.5.1 lib/tasks/resources.rake
lcms-engine-0.5.0 lib/tasks/resources.rake
lcms-engine-0.4.2 lib/tasks/resources.rake
lcms-engine-0.4.1 lib/tasks/resources.rake
lcms-engine-0.4.0 lib/tasks/resources.rake
lcms-engine-0.3.1 lib/tasks/resources.rake
lcms-engine-0.1.4 lib/tasks/resources.rake
lcms-engine-0.3.0 lib/tasks/resources.rake
lcms-engine-0.1.3 lib/tasks/resources.rake
lcms-engine-0.2.0 lib/tasks/resources.rake
lcms-engine-0.1.2 lib/tasks/resources.rake
lcms-engine-0.1.0 lib/tasks/resources.rake