Sha256: b8e66db645ae13ae9ecb4285bc134d7032fb9aa69f1d5a1ceb090d07e2daf112

Contents?: true

Size: 905 Bytes

Versions: 1

Compression:

Stored size: 905 Bytes

Contents

module Redmineup
  module Patches
    module Compatibility
      module RoutingMapperPatch
        def self.included(base)
          base.send(:include, InstanceMethods)

          base.class_eval do
            alias_method :constraints_without_redmineup, :constraints
            alias_method :constraints, :constraints_with_redmineup
          end
        end

        module InstanceMethods
          def constraints_with_redmineup(options = {}, &block)
            options[:object_type] = /.+/ if options[:object_type] && options[:object_type].is_a?(Regexp)
            constraints_without_redmineup(options, &block)
          end
        end
      end
    end
  end
end

unless ActionDispatch::Routing::Mapper.included_modules.include?(Redmineup::Patches::Compatibility::RoutingMapperPatch)
  ActionDispatch::Routing::Mapper.send(:include, Redmineup::Patches::Compatibility::RoutingMapperPatch)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redmineup-1.0.3 lib/redmineup/patches/compatibility/routing_mapper_patch.rb