Sha256: a96976eb66d325fbc291d3c009ace161e16a5267fe816c6ce660912488568a47

Contents?: true

Size: 1.04 KB

Versions: 8

Compression:

Stored size: 1.04 KB

Contents

module StandaloneMigrations
  class Tasks
    class << self
      def configure
        Deprecations.new.call
        configurator = Configurator.new
        paths = Rails.application.config.paths
        paths.add "config/database", :with => configurator.config
        paths.add "db/migrate", :with => configurator.migrate_dir
        paths.add "db/seeds.rb", :with => configurator.seeds
      end

      def load_tasks
        configure
        Configurator.environments_config do |proxy|
          ActiveRecord::Tasks::DatabaseTasks.database_configuration = proxy.configurations
        end
        MinimalRailtieConfig.load_tasks
        %w(
          connection
          environment
          db/new_migration
        ).each do
          |task| load "standalone_migrations/tasks/#{task}.rake"
        end
        load "active_record/railties/databases.rake"
      end
    end
  end

  class Tasks::Deprecations
    def call
      if File.directory?('db/migrations')
        puts "DEPRECATED move your migrations into db/migrate"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
standalone_migrations-5.2.5 lib/standalone_migrations/tasks.rb
standalone_migrations-5.2.4 lib/standalone_migrations/tasks.rb
standalone_migrations-5.2.3 lib/standalone_migrations/tasks.rb
standalone_migrations-5.2.2 lib/standalone_migrations/tasks.rb
standalone_migrations-5.2.1 lib/standalone_migrations/tasks.rb
standalone_migrations-5.2.0 lib/standalone_migrations/tasks.rb
standalone_migrations-5.0.0 lib/standalone_migrations/tasks.rb
standalone_migrations-4.0.5 lib/standalone_migrations/tasks.rb