Sha256: b1dacae023f142e812451af4389328ef02d88fd0586e25211835986850f74db0

Contents?: true

Size: 823 Bytes

Versions: 4

Compression:

Stored size: 823 Bytes

Contents

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

        base.class_eval do
          alias_method :constraints_without_redmine_crm, :constraints
          alias_method :constraints, :constraints_with_redmine_crm
        end
      end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
redmine_crm-0.0.62 lib/redmine_crm/compatibility/routing_mapper_patch.rb
redmine_crm-0.0.61 lib/redmine_crm/compatibility/routing_mapper_patch.rb
redmine_crm-0.0.60 lib/redmine_crm/compatibility/routing_mapper_patch.rb
redmine_crm-0.0.59 lib/redmine_crm/compatibility/routing_mapper_patch.rb