Sha256: c50d7bfc21560e33e19966102e236beb0644b837dae862efad2b46758dd4a124

Contents?: true

Size: 476 Bytes

Versions: 4

Compression:

Stored size: 476 Bytes

Contents

class MigrationHelper
  class << self
    def migrate(path)
      if ActiveRecord.version >= Gem::Version.new('5.2.0')
        ActiveRecord::MigrationContext.new(path).migrate
      else
        ActiveRecord::Migrator.migrate(path)
      end
    end

    def rollback(path)
      if ActiveRecord.version >= Gem::Version.new('5.2.0')
        ActiveRecord::MigrationContext.new(path).rollback
      else
        ActiveRecord::Migrator.rollback(path)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sorcery-0.15.1 spec/support/migration_helper.rb
sorcery-0.15.0 spec/support/migration_helper.rb
sorcery-0.14.0 spec/support/migration_helper.rb
sorcery-0.13.0 spec/support/migration_helper.rb