Sha256: 470555246d66f04dc26fa84fb2dbdcf79754a9f33879c9f99ede9922bf71beb1

Contents?: true

Size: 762 Bytes

Versions: 1

Compression:

Stored size: 762 Bytes

Contents

# frozen_string_literal: true

require 'redmine/plugin'

module RedminePluginsHelper
  module Patches
    module Redmine
      module PluginMigrationContext
        extend ActiveSupport::Concern

        def get_all_versions # rubocop:disable Naming/AccessorMethodName
          plugin.present? ? plugin.migrations : super
        end

        private

        def plugin
          @plugin ||= ::Redmine::Plugin.registered_plugins.values.find do |plugin|
            ::File.join(plugin.directory, 'db', 'migrate') == migrations_paths
          end
        end
      end
    end
  end
end

if Redmine::Plugin.const_defined?(:MigrationContext)
  Redmine::Plugin::MigrationContext.prepend(
    RedminePluginsHelper::Patches::Redmine::PluginMigrationContext
  )
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redmine_plugins_helper-0.15.3 lib/redmine_plugins_helper/patches/redmine/plugin_migration_context.rb