Sha256: f59a5749c1ad56a99ecdc8e0b1476ba9842010875d064049b93ff7293f0b50df

Contents?: true

Size: 259 Bytes

Versions: 9

Compression:

Stored size: 259 Bytes

Contents

class RedirectLegacyProductUrl
  def initialize(app)
    @app = app
  end
  
  def call(env)                
    if env["PATH_INFO"] =~ %r{/t/.+/p/(.+)}      
      return [301, {'Location'=> "/products/#{$1}" }, []]  
    end
    @app.call(env)
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree_core-0.30.2 lib/redirect_legacy_product_url.rb
spree_core-0.40.4 lib/redirect_legacy_product_url.rb
spree_core-0.40.3 lib/redirect_legacy_product_url.rb
spree_core-0.40.2 lib/redirect_legacy_product_url.rb
spree_core-0.40.1 lib/redirect_legacy_product_url.rb
spree_core-0.40.0 lib/redirect_legacy_product_url.rb
spree_core-0.30.1 lib/redirect_legacy_product_url.rb
spree_core-0.30.0 lib/redirect_legacy_product_url.rb
spree_core-0.30.0.beta1 lib/redirect_legacy_product_url.rb