Sha256: c6cd351bae4c2ef51953b49be046052c4433ac3e8e13cd02a5dd4cb246da9771

Contents?: true

Size: 911 Bytes

Versions: 48

Compression:

Stored size: 911 Bytes

Contents

module BlacklightRangeLimit
  # This module is monkey-patch included into Blacklight::Routes, so that
  # map_resource will route to catalog#range_limit, for our action
  # that fetches and returns range segments -- that action is
  # also monkey patched into (eg) CatalogController.
  module RouteSets
    extend ActiveSupport::Concern


    included do |klass|
      # Have to add ours BEFORE existing,
      # so catalog/range_limit can take priority over
      # being considered a document ID.
      klass.default_route_sets = [:range_limit] + klass.default_route_sets
    end


    protected


    # Add route for (eg) catalog/range_limit, pointing to the range_limit
    # method we monkey patch into (eg) CatalogController.
    def range_limit(primary_resource)
      add_routes do |options|
        get "#{primary_resource}/range_limit" => "#{primary_resource}#range_limit"
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
blacklight_range_limit-9.0.0.beta1 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.5.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.4.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.3.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-7.0.1 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.2.3 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.2.2 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.2.1 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.2.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.1.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.0.1 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-8.0.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-7.9.1 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-7.9.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-6.5.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-7.8.2 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-7.8.1 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-7.8.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-7.7.0 lib/blacklight_range_limit/route_sets.rb
blacklight_range_limit-6.4.0 lib/blacklight_range_limit/route_sets.rb