Module: SolidusStaticContent::RouteMatcher

Defined in:
lib/solidus_static_content/route_matcher.rb

Constant Summary collapse

EXCLUDED_PATHS =
%r{^/+(admin|account|cart|checkout|content|login|pg/|orders|products|s/|session|signup|shipments|states|t/|tax_categories|user)+}

Class Method Summary collapse

Class Method Details

.matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
# File 'lib/solidus_static_content/route_matcher.rb', line 7

def self.matches?(request)
  path = request.path_info

  return false if EXCLUDED_PATHS.match? path

  Spree::Page.visible.where(slug: path).exists?
end