Sha256: 11b891e16df6295fd954265547488c15da3ac81baf722e6cfc657fb6751a307f

Contents?: true

Size: 681 Bytes

Versions: 2

Compression:

Stored size: 681 Bytes

Contents

# typed: true
# frozen_string_literal: true

require "lazy_migrate/old_migrator_adapter"
require "lazy_migrate/new_migrator_adapter"

module LazyMigrate
  class MigratorAdapterFactory
    class << self
      # unfortunately the code is a little different from 5.2 onwards compared to previous
      # versions, and we want to do more than just invoke the db:migrate rake
      # commands so we're returning a different adapter depending on the rails
      # version
      def create_migrator_adapter
        if Rails.version > '5.2.0'
          LazyMigrate::NewMigratorAdapter.new
        else
          LazyMigrate::OldMigratorAdapter.new
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lazy_migrate-0.3.0 lib/lazy_migrate/migrator_adapter_factory.rb
lazy_migrate-0.2.0 lib/lazy_migrate/migrator_adapter_factory.rb