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-0.5.40 lib/tasks/marty_tasks.rake
marty-0.5.39 lib/tasks/marty_tasks.rake
marty-0.5.38 lib/tasks/marty_tasks.rake
marty-0.5.36 lib/tasks/marty_tasks.rake
marty-0.5.35 lib/tasks/marty_tasks.rake
marty-0.5.34 lib/tasks/marty_tasks.rake
marty-0.5.33 lib/tasks/marty_tasks.rake
marty-0.5.32 lib/tasks/marty_tasks.rake
marty-0.5.31 lib/tasks/marty_tasks.rake
marty-0.5.30 lib/tasks/marty_tasks.rake
marty-0.5.29 lib/tasks/marty_tasks.rake
marty-0.5.28 lib/tasks/marty_tasks.rake
marty-0.5.27 lib/tasks/marty_tasks.rake
marty-0.5.26 lib/tasks/marty_tasks.rake
marty-0.5.25 lib/tasks/marty_tasks.rake
marty-0.5.24 lib/tasks/marty_tasks.rake
marty-0.5.23 lib/tasks/marty_tasks.rake
marty-0.5.21 lib/tasks/marty_tasks.rake
marty-0.5.20 lib/tasks/marty_tasks.rake
marty-0.5.19 lib/tasks/marty_tasks.rake