Sha256: e238f0c690b952a95ac1aed68ee934530204ca21408b02bca1e4044742a907dc

Contents?: true

Size: 545 Bytes

Versions: 2

Compression:

Stored size: 545 Bytes

Contents

require "createk_data_migrator/version"
require "createk_data_migrator/railtie" if defined?(Rails)

class CreatekDataMigrator
  class << self
    attr_writer :data_migrations_path

    def migrate
      begin
        old_paths = ActiveRecord::Tasks::DatabaseTasks.migrations_paths
        ActiveRecord::Tasks::DatabaseTasks.migrations_paths = [Rails.root.join('db/migrate_data')]

        ActiveRecord::Tasks::DatabaseTasks.migrate
      ensure
        ActiveRecord::Tasks::DatabaseTasks.migrations_paths = old_paths
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
createk_data_migrator-0.1.2 lib/createk_data_migrator.rb
createk_data_migrator-0.1.1 lib/createk_data_migrator.rb