Sha256: 4da61605ea9786ebcde775f340d1b0ba9a6d5aaba5e5b1a820e5f159d2c4d057

Contents?: true

Size: 690 Bytes

Versions: 1

Compression:

Stored size: 690 Bytes

Contents

namespace :db do
  namespace :fixtures do
    desc 'Dumps all models into fixtures.'
    task :dump, [:path, :included, :excluded] => :environment do |t, args|
      path = args[:path].to_s
      included = args[:included].to_s.split(" ")
      excluded = args[:excluded].to_s.split(" ")
      yaml_creator = SmartDump::YamlCreator.new(
        path: path, included_models: included, excluded_models: excluded
      )

      yaml_creator.dump_models!
    end

    desc 'Loads fixtures into database'
    task :seed, [:path] => :environment do |t, args|
      path = args.fetch(:path)

      yaml_loader = SmartDump::YamlLoader.new(path)

      yaml_loader.load_fixtures!
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smart_dump-0.1.0 lib/tasks/smart_dump.rake