Module: SolidusStaticContent::RouteMatcher

Defined in:
lib/solidus_static_content/route_matcher.rb

Constant Summary collapse

EXCLUDED_PATHS =
/^\/+(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)


4
5
6
7
8
9
10
# File 'lib/solidus_static_content/route_matcher.rb', line 4

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

  return false if EXCLUDED_PATHS.match? path

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