Sha256: b01e03dc592ed5e14051cf373c09795c512b3472f297f4826942541fd9f86f53

Contents?: true

Size: 1.01 KB

Versions: 87

Compression:

Stored size: 1.01 KB

Contents

namespace :marty do
  desc 'Load Engine Seed data.'
  task seed: :environment do
    begin
      Marty::Engine.load_seed
      puts "Database has been seeded with Marty Engine data."
    rescue => error
      puts "Error: ", error
    end
  end

  desc 'remove all loaded scripts from the database'
  task delete_scripts: :environment do
    Marty::Script.delete_scripts
  end

  desc 'load scripts from the LOAD_DIR directory'
  task load_scripts: :environment do
    Mcfly.whodunnit =
      Marty::User.find_by_login(Rails.configuration.marty.system_account)
    raise 'must have system user account seeded' unless Mcfly.whodunnit
    load_dir = ENV['LOAD_DIR']
    Marty::Script.load_scripts(load_dir)
  end

  desc 'Print out all models and their fields'
  task print_schema: :environment do
    Rails.application.eager_load!
    ActiveRecord::Base.descendants.sort_by(&:name).each do |model|
      puts model.name
      model.attribute_names.each do |attribute|
        puts "  #{attribute}"
      end
      puts
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
marty-1.0.42 lib/tasks/marty_tasks.rake
marty-1.0.41 lib/tasks/marty_tasks.rake
marty-1.0.39 lib/tasks/marty_tasks.rake
marty-1.0.38 lib/tasks/marty_tasks.rake
marty-1.0.37 lib/tasks/marty_tasks.rake
marty-1.0.36 lib/tasks/marty_tasks.rake
marty-1.0.35 lib/tasks/marty_tasks.rake
marty-1.0.34 lib/tasks/marty_tasks.rake
marty-1.0.33 lib/tasks/marty_tasks.rake
marty-1.0.32 lib/tasks/marty_tasks.rake
marty-1.0.31 lib/tasks/marty_tasks.rake
marty-1.0.30 lib/tasks/marty_tasks.rake
marty-1.0.29 lib/tasks/marty_tasks.rake
marty-1.0.28 lib/tasks/marty_tasks.rake
marty-1.0.27 lib/tasks/marty_tasks.rake
marty-1.0.26 lib/tasks/marty_tasks.rake
marty-1.0.25 lib/tasks/marty_tasks.rake
marty-1.0.24 lib/tasks/marty_tasks.rake
marty-1.0.23 lib/tasks/marty_tasks.rake
marty-1.0.22 lib/tasks/marty_tasks.rake